dovecot-1.1: Fixed proxy_maybe handling.

dovecot at dovecot.org dovecot at dovecot.org
Thu Feb 21 15:56:23 EET 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/27b7b6c34961
changeset: 7278:27b7b6c34961
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Feb 21 15:57:48 2008 +0200
description:
Fixed proxy_maybe handling.

diffstat:

1 file changed, 11 insertions(+), 7 deletions(-)
src/auth/auth-request.c |   18 +++++++++++-------

diffs (40 lines):

diff -r e0debdcd2e10 -r 27b7b6c34961 src/auth/auth-request.c
--- a/src/auth/auth-request.c	Thu Feb 21 15:40:13 2008 +0200
+++ b/src/auth/auth-request.c	Thu Feb 21 15:57:48 2008 +0200
@@ -985,7 +985,6 @@ static void auth_request_set_reply_field
 		   ourself */
 		request->proxy = TRUE;
 		request->proxy_maybe = TRUE;
-		name = "proxy";
 		value = NULL;
 	}
 
@@ -1261,17 +1260,22 @@ void auth_request_proxy_finish(struct au
 
 	if (!success) {
 		/* drop all proxy fields */
+	} else if (!request->proxy_maybe) {
+		/* proxying */
+		request->no_login = TRUE;
+		return;
+	} else if (!auth_request_proxy_is_self(request)) {
+		/* proxy destination isn't ourself - proxy */
+		auth_stream_reply_remove(request->extra_fields, "proxy_maybe");
+		auth_stream_reply_add(request->extra_fields, "proxy", NULL);
+		request->no_login = TRUE;
+		return;
 	} else {
-		if (!request->proxy_maybe ||
-		    !auth_request_proxy_is_self(request)) {
-			request->no_login = TRUE;
-			return;
-		}
-
 		/* proxying to ourself - log in without proxying by dropping
 		   all the proxying fields. */
 	}
 	auth_stream_reply_remove(request->extra_fields, "proxy");
+	auth_stream_reply_remove(request->extra_fields, "proxy_maybe");
 	auth_stream_reply_remove(request->extra_fields, "host");
 	auth_stream_reply_remove(request->extra_fields, "port");
 	auth_stream_reply_remove(request->extra_fields, "destuser");


More information about the dovecot-cvs mailing list