]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: silence var_expand_with_funcs in db-ldap
authorMartti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
Tue, 13 Dec 2016 18:03:41 +0000 (20:03 +0200)
committerGitLab <gitlab@git.dovecot.net>
Wed, 14 Dec 2016 15:31:15 +0000 (17:31 +0200)
This needs to be silenced since it's logging errors of variable
expansions that are not meant to be successful. The function is used
here just for filling the attr_names array in ldap_field_find_context
and the resulting string is not used.

src/auth/db-ldap.c

index efdb4139fea2a5a7b1aacc190b56eacab22d4caa..556472fe35481d77d42a1dd323b53783e1756ddb 100644 (file)
@@ -1419,8 +1419,12 @@ void db_ldap_set_attrs(struct ldap_connection *conn, const char *attrlist,
                        str_truncate(tmp_str, 0);
                        if (var_expand_with_funcs(tmp_str, templ, NULL,
                                                  var_funcs_table, &ctx, &error) <= 0) {
-                               i_error("LDAP %s: Failed to expand attr_names=%s: %s",
-                                       conn->config_path, name, error);
+                               /* This var_expand_with_funcs call fills the
+                                * ldap_field_find_context in ctx, but the
+                                * resulting string_t is not used, and the
+                                * return value or error_r is not checked since
+                                * it gives errors for non-ldap variable
+                                * expansions. */
                        }
                        if (strchr(templ, '%') == NULL) {
                                /* backwards compatibility: