dovecot-2.2: auth: If passdb/userdb changes the username, add th...

dovecot at dovecot.org dovecot at dovecot.org
Mon Apr 13 17:39:33 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/635f9c7d5991
changeset: 18402:635f9c7d5991
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Apr 13 20:38:10 2015 +0300
description:
auth: If passdb/userdb changes the username, add the changed username also to the cache.

diffstat:

 src/auth/auth-request.c |  7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diffs (17 lines):

diff -r 08b2f79e8212 -r 635f9c7d5991 src/auth/auth-request.c
--- a/src/auth/auth-request.c	Mon Apr 13 20:37:48 2015 +0300
+++ b/src/auth/auth-request.c	Mon Apr 13 20:38:10 2015 +0300
@@ -973,6 +973,13 @@
 		auth_fields_append(request->userdb_reply, str,
 				   AUTH_FIELD_FLAG_CHANGED,
 				   AUTH_FIELD_FLAG_CHANGED);
+		if (strcmp(request->user, request->translated_username) != 0) {
+			/* username was changed by passdb or userdb */
+			if (str_len(str) > 0)
+				str_append_c(str, '\t');
+			str_append(str, "user=");
+			str_append_tabescaped(str, request->user);
+		}
 		if (str_len(str) == 0) {
 			/* no userdb fields. but we can't save an empty string,
 			   since that means "user unknown". */


More information about the dovecot-cvs mailing list