changeset 19970:33d2f1e44b78

auth: Disable auth caching for passwd-file Its caching is usually unnecessary, because the passwd-files are efficiently in memory already. It's also problematic, because extra_fields can contain %variables, which can be lookup-dependent. So for example if %{lport} is used in extra_fields, it would need to be included in the cache key. But because different variables can be used by different users' extra_fields, there's really no good way to include all of it in the cache key.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Tue, 29 Mar 2016 15:17:29 +0300
parents 001dcd7c0c7c
children 17c480995bc9
files src/auth/passdb-passwd-file.c src/auth/userdb-passwd-file.c
diffstat 2 files changed, 0 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/src/auth/passdb-passwd-file.c	Tue Mar 29 15:04:01 2016 +0300
+++ b/src/auth/passdb-passwd-file.c	Tue Mar 29 15:17:29 2016 +0300
@@ -150,14 +150,6 @@
 	module->pwf = db_passwd_file_init(args, FALSE,
 					  global_auth_settings->debug);
 	module->username_format = format;
-
-	if (!module->pwf->vars)
-		module->module.default_cache_key = format;
-	else {
-		module->module.default_cache_key = auth_cache_parse_key(pool,
-			t_strconcat(format, module->pwf->path, NULL));
-	}
-
 	module->module.default_pass_scheme = scheme;
 	return &module->module;
 }
--- a/src/auth/userdb-passwd-file.c	Tue Mar 29 15:04:01 2016 +0300
+++ b/src/auth/userdb-passwd-file.c	Tue Mar 29 15:17:29 2016 +0300
@@ -13,8 +13,6 @@
 #include <unistd.h>
 #include <fcntl.h>
 
-#define PASSWD_FILE_CACHE_KEY "%u"
-
 struct passwd_file_userdb_iterate_context {
 	struct userdb_iterate_context ctx;
 	struct istream *input;
@@ -191,16 +189,6 @@
 	module->pwf = db_passwd_file_init(args, TRUE,
 					  global_auth_settings->debug);
 	module->username_format = format;
-
-	if (!module->pwf->vars)
-		module->module.default_cache_key = PASSWD_FILE_CACHE_KEY;
-	else {
-		module->module.default_cache_key =
-			auth_cache_parse_key(pool,
-					     t_strconcat(PASSWD_FILE_CACHE_KEY,
-						         module->pwf->path,
-							 NULL));
-	}
 	return &module->module;
 }