Skip to content

Commit

Permalink
auth: Don't log errors when cache_key expansion finds unknown %variables
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen committed Dec 14, 2016
1 parent 05546cc commit 9c77606
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/auth/auth-cache.c
Expand Up @@ -349,8 +349,15 @@ auth_request_expand_cache_key(const struct auth_request *request,
request->master_user == NULL ? "" : "+%{master_user}",
"\t", key, NULL);

/* It's fine to have unknown %variables in the cache key.
For example db-ldap can have pass_attrs containing
%{ldap:fields} which are used for output, not as part of
the input needed for cache_key. Those could in theory be
filtered out early in the cache_key, but that gets more
problematic when it needs to support also filtering out
e.g. %{sha256:ldap:fields}. */
if (t_auth_request_var_expand(key, request, auth_cache_escape,
&value, &error) <= 0 && !error_logged) {
&value, &error) < 0 && !error_logged) {
error_logged = TRUE;
i_error("Failed to expand auth cache key %s: %s", key, error);
}
Expand Down

0 comments on commit 9c77606

Please sign in to comment.