From db966fce2a30ac996d90ad31daffe47734ef4ad9 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 24 Apr 2008 16:31:07 +0300 Subject: [PATCH] Allow %variables in static LDAP fields. --HG-- branch : HEAD --- src/auth/db-ldap.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/auth/db-ldap.c b/src/auth/db-ldap.c index f6a60a4d6b..4d28957d90 100644 --- a/src/auth/db-ldap.c +++ b/src/auth/db-ldap.c @@ -979,8 +979,15 @@ db_ldap_result_iterate_init(struct ldap_connection *conn, LDAPMessage *entry, ctx->attr_map = attr_map; static_data = hash_lookup(attr_map, ""); - if (static_data != NULL) - ctx->static_attrs = t_strsplit(static_data, ","); + if (static_data != NULL) { + const struct var_expand_table *table; + string_t *str; + + table = auth_request_get_var_expand_table(auth_request, NULL); + str = t_str_new(256); + var_expand(str, static_data, table); + ctx->static_attrs = t_strsplit(str_c(str), ","); + } if (auth_request->auth->verbose_debug) ctx->debug = t_str_new(256); -- 2.47.3