dovecot-2.1: lib-storage: When mail_debug=yes logs userdb fields...

dovecot at dovecot.org dovecot at dovecot.org
Tue Sep 6 17:04:39 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/af6a6da91978
changeset: 13409:af6a6da91978
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Sep 06 17:03:55 2011 +0300
description:
lib-storage: When mail_debug=yes logs userdb fields, hide values of all whose key contains "pass".

diffstat:

 src/lib-storage/mail-storage-service.c |  5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diffs (15 lines):

diff -r 1180505cdcdb -r af6a6da91978 src/lib-storage/mail-storage-service.c
--- a/src/lib-storage/mail-storage-service.c	Tue Sep 06 17:03:06 2011 +0300
+++ b/src/lib-storage/mail-storage-service.c	Tue Sep 06 17:03:55 2011 +0300
@@ -164,6 +164,11 @@
 
 	ret = settings_parse_line(set_parser, line);
 	if (mail_debug && ret >= 0) {
+		if (strstr(key, "pass") != NULL) {
+			/* possibly a password field (e.g. imapc_password).
+			   hide the value. */
+			line = t_strconcat(key, "=<hidden>", NULL);
+		}
 		i_debug(ret == 0 ?
 			"Unknown userdb setting: %s" :
 			"Added userdb setting: %s", line);


More information about the dovecot-cvs mailing list