[dovecot-cvs] dovecot/src/auth passdb-passwd-file.c, 1.28.2.1, 1.28.2.2
tss at dovecot.org
tss at dovecot.org
Sun Oct 15 21:06:53 UTC 2006
Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv28625
Modified Files:
Tag: branch_1_0
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.28.2.1
retrieving revision 1.28.2.2
diff -u -d -r1.28.2.1 -r1.28.2.2
--- passdb-passwd-file.c 24 Jun 2006 19:02:39 -0000 1.28.2.1
+++ passdb-passwd-file.c 15 Oct 2006 20:06:51 -0000 1.28.2.2
@@ -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