From: Martti Rannanjärvi Date: Tue, 13 Dec 2016 18:03:41 +0000 (+0200) Subject: auth: silence var_expand_with_funcs in db-ldap X-Git-Tag: 2.3.0.rc1~2437 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ec8e55a73623e40dfce9bfb5a60abf047788b222;p=thirdparty%2Fdovecot%2Fcore.git auth: silence var_expand_with_funcs in db-ldap 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. --- diff --git a/src/auth/db-ldap.c b/src/auth/db-ldap.c index efdb4139fe..556472fe35 100644 --- a/src/auth/db-ldap.c +++ b/src/auth/db-ldap.c @@ -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: