]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Allow %variables in static LDAP fields.
authorTimo Sirainen <tss@iki.fi>
Thu, 24 Apr 2008 13:31:07 +0000 (16:31 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 24 Apr 2008 13:31:07 +0000 (16:31 +0300)
--HG--
branch : HEAD

src/auth/db-ldap.c

index f6a60a4d6b0e4afb698480f2f0b03847fb99463a..4d28957d90cf2c27bc92fd76b7093dad8374a620 100644 (file)
@@ -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);