]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Fix auth caching to work with passdb_ldap_bind_userdn
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 6 Nov 2025 12:20:05 +0000 (14:20 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 13 Nov 2025 22:50:48 +0000 (22:50 +0000)
passdb_ldap_bind_userdn wasn't part of the cache key, so:
 * If no %variables were given in ldap_base or passdb_ldap_filter, startup
   failed with "Cache key must contain at least one variable"
 * If the same %variables were part of ldap_base or passdb_ldap_filter,
   it worked correctly.
 * If different %variables were part of ldap_base or passdb_ldap_filter,
   cached lookups may have returned wrong results.

src/auth/passdb-ldap.c

index b2d284409465c636d9d44e17d94d99a591863cbd..6d7702c6292ac5f39b4b9d7f7be429efb520af91 100644 (file)
@@ -465,6 +465,7 @@ static int passdb_ldap_preinit(pool_t pool, struct event *event,
 
        module->module.default_cache_key = auth_cache_parse_key_and_fields(
                pool, t_strconcat(ldap_pre->ldap_base,
+                                 ldap_pre->passdb_ldap_bind_userdn,
                                  ldap_pre->passdb_ldap_filter, NULL),
                &auth_post->fields, NULL);