[dovecot-cvs] dovecot/src/auth passdb-passwd-file.c,1.29,1.30

tss at dovecot.org tss at dovecot.org
Sun Oct 15 21:06:56 UTC 2006


Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv28637

Modified Files:
	passdb-passwd-file.c 
Log Message:
If auth cache is enabled and %vars are used in passwd-file path, get the
non-username part of the cache key from the path.



Index: passdb-passwd-file.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb-passwd-file.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- passdb-passwd-file.c	24 Jun 2006 19:02:40 -0000	1.29
+++ passdb-passwd-file.c	15 Oct 2006 20:06:53 -0000	1.30
@@ -5,6 +5,7 @@
 #ifdef PASSDB_PASSWD_FILE
 
 #include "str.h"
+#include "auth-cache.h"
 #include "var-expand.h"
 #include "passdb.h"
 #include "password-scheme.h"
@@ -119,10 +120,20 @@
 	module = p_new(auth_passdb->auth->pool,
 		       struct passwd_file_passdb_module, 1);
 	module->auth = auth_passdb->auth;
-	module->module.cache_key = PASSWD_FILE_CACHE_KEY;
-	module->module.default_pass_scheme = PASSWD_FILE_DEFAULT_SCHEME;
 	module->pwf =
 		db_passwd_file_init(args, FALSE, module->auth->verbose_debug);
+
+	if (!module->pwf->vars)
+		module->module.cache_key = PASSWD_FILE_CACHE_KEY;
+	else {
+		module->module.cache_key =
+			auth_cache_parse_key(auth_passdb->auth->pool,
+					     t_strconcat(PASSWD_FILE_CACHE_KEY,
+							 module->pwf->path,
+							 NULL));
+	}
+
+	module->module.default_pass_scheme = PASSWD_FILE_DEFAULT_SCHEME;
 	return &module->module;
 }
 



More information about the dovecot-cvs mailing list