dovecot: Store cache_key via auth_cache_parse_key() which adds T...

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


details:   http://hg.dovecot.org/dovecot/rev/17e056f924cb
changeset: 6241:17e056f924cb
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Aug 09 14:34:41 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 3a1ff50a57b7 -r 17e056f924cb src/auth/passdb-bsdauth.c
--- a/src/auth/passdb-bsdauth.c	Thu Aug 09 13:39:08 2007 +0300
+++ b/src/auth/passdb-bsdauth.c	Thu Aug 09 14:34:41 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 3a1ff50a57b7 -r 17e056f924cb src/auth/passdb-pam.c
--- a/src/auth/passdb-pam.c	Thu Aug 09 13:39:08 2007 +0300
+++ b/src/auth/passdb-pam.c	Thu Aug 09 14:34:41 2007 +0300
@@ -17,6 +17,7 @@
 #include "network.h"
 #include "passdb.h"
 #include "safe-memset.h"
+#include "auth-cache.h"
 
 #include <stdlib.h>
 
@@ -290,8 +291,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) {
 			/* ignore, for backwards compatibility */
 		} else if (strcmp(t_args[i], "failure_show_msg=yes") == 0) {
diff -r 3a1ff50a57b7 -r 17e056f924cb src/auth/passdb-vpopmail.c
--- a/src/auth/passdb-vpopmail.c	Thu Aug 09 13:39:08 2007 +0300
+++ b/src/auth/passdb-vpopmail.c	Thu Aug 09 14:34:41 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