dovecot-2.2: auth: Don't add proxy/pass fields when we're only a...

dovecot at dovecot.org dovecot at dovecot.org
Wed Oct 3 00:41:22 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/ff66315076ce
changeset: 15173:ff66315076ce
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Oct 03 00:41:18 2012 +0300
description:
auth: Don't add proxy/pass fields when we're only authenticating (not logging in).
For example SMTP server doesn't need these fields when doing SMTP AUTH.

diffstat:

 src/auth/auth-request-handler.c |  3 ++-
 src/auth/auth-request.c         |  2 +-
 src/auth/auth-request.h         |  1 +
 3 files changed, 4 insertions(+), 2 deletions(-)

diffs (43 lines):

diff -r 8802322d7257 -r ff66315076ce src/auth/auth-request-handler.c
--- a/src/auth/auth-request-handler.c	Thu Aug 30 00:43:56 2012 +0200
+++ b/src/auth/auth-request-handler.c	Wed Oct 03 00:41:18 2012 +0300
@@ -181,7 +181,7 @@
 		}
 	}
 
-	if (request->proxy) {
+	if (request->proxy && !request->auth_only) {
 		/* we're proxying */
 		if (!seen_pass && request->mech_password != NULL) {
 			/* send back the password that was sent by user
@@ -490,6 +490,7 @@
 	request->connect_uid = handler->connect_uid;
 	request->client_pid = handler->client_pid;
 	request->id = id;
+	request->auth_only = handler->master_callback == NULL;
 
 	/* parse optional parameters */
 	initial_resp = NULL;
diff -r 8802322d7257 -r ff66315076ce src/auth/auth-request.c
--- a/src/auth/auth-request.c	Thu Aug 30 00:43:56 2012 +0200
+++ b/src/auth/auth-request.c	Wed Oct 03 00:41:18 2012 +0300
@@ -1633,7 +1633,7 @@
 {
 	int ret;
 
-	if (!request->proxy)
+	if (!request->proxy || request->auth_only)
 		return 1;
 
 	if ((ret = auth_request_proxy_host_lookup(request, callback)) <= 0)
diff -r 8802322d7257 -r ff66315076ce src/auth/auth-request.h
--- a/src/auth/auth-request.h	Thu Aug 30 00:43:56 2012 +0200
+++ b/src/auth/auth-request.h	Wed Oct 03 00:41:18 2012 +0300
@@ -101,6 +101,7 @@
 	unsigned int passdb_internal_failure:1;
 	unsigned int userdb_internal_failure:1;
 	unsigned int delayed_failure:1;
+	unsigned int auth_only:1;
 	unsigned int domain_is_realm:1;
 	unsigned int accept_input:1;
 	unsigned int no_failure_delay:1;


More information about the dovecot-cvs mailing list