dovecot-1.0: Store cache_key via auth_cache_parse_key() which ad...

dovecot at dovecot.org dovecot at dovecot.org
Thu Aug 9 14:34:48 EEST 2007


details:   http://hg.dovecot.org/dovecot-1.0/rev/1613913055eb
changeset: 5371:1613913055eb
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Aug 09 14:34:42 2007 +0300
description:
Store cache_key via auth_cache_parse_key() which adds TABs between the
%variables, making it safer.

diffstat:

3 files changed, 7 insertions(+), 4 deletions(-)
src/auth/passdb-bsdauth.c  |    3 ++-
src/auth/passdb-pam.c      |    5 +++--
src/auth/passdb-vpopmail.c |    3 ++-

diffs (48 lines):

diff -r 696c9d5fcf71 -r 1613913055eb src/auth/passdb-bsdauth.c
--- a/src/auth/passdb-bsdauth.c	Thu Aug 09 13:40:34 2007 +0300
+++ b/src/auth/passdb-bsdauth.c	Thu Aug 09 14:34:42 2007 +0300
@@ -56,7 +56,8 @@ bsdauth_preinit(struct auth_passdb *auth
 
 	if (strncmp(args, "cache_key=", 10) == 0) {
 		module->cache_key =
-			p_strdup(auth_passdb->auth->pool, args + 10);
+			auth_cache_parse_key(auth_passdb->auth->pool,
+					     args + 10);
 	}
 	return module;
 }
diff -r 696c9d5fcf71 -r 1613913055eb src/auth/passdb-pam.c
--- a/src/auth/passdb-pam.c	Thu Aug 09 13:40:34 2007 +0300
+++ b/src/auth/passdb-pam.c	Thu Aug 09 14:34:42 2007 +0300
@@ -18,6 +18,7 @@
 #include "network.h"
 #include "passdb.h"
 #include "safe-memset.h"
+#include "auth-cache.h"
 
 #include <stdlib.h>
 #include <fcntl.h>
@@ -502,8 +503,8 @@ pam_preinit(struct auth_passdb *auth_pas
 			module->pam_setcred = TRUE;
 		else if (strncmp(t_args[i], "cache_key=", 10) == 0) {
 			module->module.cache_key =
-				p_strdup(auth_passdb->auth->pool,
-					 t_args[i] + 10);
+				auth_cache_parse_key(auth_passdb->auth->pool,
+						     t_args[i] + 10);
 		} else if (strcmp(t_args[i], "blocking=yes") == 0) {
 			module->module.blocking = TRUE;
 		} else if (strcmp(t_args[i], "*") == 0) {
diff -r 696c9d5fcf71 -r 1613913055eb src/auth/passdb-vpopmail.c
--- a/src/auth/passdb-vpopmail.c	Thu Aug 09 13:40:34 2007 +0300
+++ b/src/auth/passdb-vpopmail.c	Thu Aug 09 14:34:42 2007 +0300
@@ -136,7 +136,8 @@ vpopmail_preinit(struct auth_passdb *aut
 
 	if (strncmp(args, "cache_key=", 10) == 0) {
 		module->cache_key =
-			p_strdup(auth_passdb->auth->pool, args + 10);
+			auth_cache_parse_key(auth_passdb->auth->pool,
+					     args + 10);
 	}
 	return module;
 }


More information about the dovecot-cvs mailing list