From: Timo Sirainen Date: Fri, 26 Jan 2024 15:09:20 +0000 (+0200) Subject: auth: Add passdb_use_cache setting X-Git-Tag: 2.4.1~1089 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a74a14f4bad3723ec68562b90fde4180404c088;p=thirdparty%2Fdovecot%2Fcore.git auth: Add passdb_use_cache setting --- diff --git a/src/auth/auth-settings.c b/src/auth/auth-settings.c index 61fa0bf25a..1f677b17ad 100644 --- a/src/auth/auth-settings.c +++ b/src/auth/auth-settings.c @@ -118,6 +118,7 @@ static const struct setting_define auth_passdb_setting_defines[] = { DEF(BOOL, deny), DEF(BOOL, master), + DEF(BOOL, use_cache), DEF(BOOL, use_worker), SETTING_DEFINE_LIST_END @@ -139,6 +140,7 @@ static const struct auth_passdb_settings auth_passdb_default_settings = { .deny = FALSE, .master = FALSE, + .use_cache = TRUE, .use_worker = FALSE, }; diff --git a/src/auth/auth-settings.h b/src/auth/auth-settings.h index f162de5daa..476708100e 100644 --- a/src/auth/auth-settings.h +++ b/src/auth/auth-settings.h @@ -30,6 +30,7 @@ struct auth_passdb_settings { const char *result_internalfail; bool deny; bool master; + bool use_cache; bool use_worker; }; diff --git a/src/auth/auth.c b/src/auth/auth.c index e5fe1e6a86..eef036d5a2 100644 --- a/src/auth/auth.c +++ b/src/auth/auth.c @@ -121,7 +121,7 @@ auth_passdb_preinit(struct auth *auth, const struct auth_passdb_settings *set, auth_passdb->passdb = passdb_preinit(auth->pool, event, set); /* make sure any %variables in default_fields exist in cache_key */ - if (auth_passdb->passdb->default_cache_key != NULL) { + if (auth_passdb->passdb->default_cache_key != NULL && set->use_cache) { struct auth_passdb_pre_settings *passdb_pre_set; const char *error; if (settings_get(event, &auth_passdb_pre_setting_parser_info,