changeset 15173:ff66315076ce

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.
author Timo Sirainen <tss@iki.fi>
date Wed, 03 Oct 2012 00:41:18 +0300
parents 8802322d7257
children f860cdf156cf
files src/auth/auth-request-handler.c src/auth/auth-request.c src/auth/auth-request.h
diffstat 3 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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)
--- 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;