dovecot-2.1: auth: Fixed handling multiple passdbs where some us...

dovecot at dovecot.org dovecot at dovecot.org
Wed Apr 25 21:32:08 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/3893f2b7e4ab
changeset: 14479:3893f2b7e4ab
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Apr 25 21:26:25 2012 +0300
description:
auth: Fixed handling multiple passdbs where some use proxying and others don't.

diffstat:

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

diffs (41 lines):

diff -r 26bf68448638 -r 3893f2b7e4ab src/auth/auth-request.c
--- a/src/auth/auth-request.c	Wed Apr 25 21:23:24 2012 +0300
+++ b/src/auth/auth-request.c	Wed Apr 25 21:26:25 2012 +0300
@@ -517,6 +517,10 @@
                 request->passdb = request->passdb->next;
 		request->passdb_password = NULL;
 
+		request->proxy = FALSE;
+		request->proxy_maybe = FALSE;
+		request->proxy_always = FALSE;
+
 		if (*result == PASSDB_RESULT_USER_UNKNOWN) {
 			/* remember that we did at least one successful
 			   passdb lookup */
@@ -1477,11 +1481,14 @@
 	} else {
 		/* proxying to ourself - log in without proxying by dropping
 		   all the proxying fields. */
+		bool proxy_always = request->proxy_always;
+
 		auth_request_proxy_finish_failure(request);
-		if (request->proxy_always) {
+		if (proxy_always) {
 			/* director adds the host */
 			auth_stream_reply_add(request->extra_fields,
 					      "proxy", NULL);
+			request->proxy = TRUE;
 		}
 	}
 }
@@ -1602,6 +1609,10 @@
 	auth_stream_reply_remove(request->extra_fields, "host");
 	auth_stream_reply_remove(request->extra_fields, "port");
 	auth_stream_reply_remove(request->extra_fields, "destuser");
+
+	request->proxy = FALSE;
+	request->proxy_maybe = FALSE;
+	request->proxy_always = FALSE;
 }
 
 static void log_password_failure(struct auth_request *request,


More information about the dovecot-cvs mailing list