From: Timo Sirainen Date: Tue, 2 Oct 2012 21:41:18 +0000 (+0300) Subject: auth: Don't add proxy/pass fields when we're only authenticating (not logging in). X-Git-Tag: 2.2.alpha1~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e31bf6003e580bcb28af333119da9dd1e16fc811;p=thirdparty%2Fdovecot%2Fcore.git 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. --- diff --git a/src/auth/auth-request-handler.c b/src/auth/auth-request-handler.c index ab12defc17..df3f859488 100644 --- a/src/auth/auth-request-handler.c +++ b/src/auth/auth-request-handler.c @@ -181,7 +181,7 @@ static void get_client_extra_fields(struct auth_request *request, } } - 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 @@ bool auth_request_handler_auth_begin(struct auth_request_handler *handler, 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 --git a/src/auth/auth-request.c b/src/auth/auth-request.c index aaed9b593d..1bc5a494ba 100644 --- a/src/auth/auth-request.c +++ b/src/auth/auth-request.c @@ -1633,7 +1633,7 @@ int auth_request_proxy_finish(struct auth_request *request, { int ret; - if (!request->proxy) + if (!request->proxy || request->auth_only) return 1; if ((ret = auth_request_proxy_host_lookup(request, callback)) <= 0) diff --git a/src/auth/auth-request.h b/src/auth/auth-request.h index 59d6315e6d..673c8d70f5 100644 --- a/src/auth/auth-request.h +++ b/src/auth/auth-request.h @@ -101,6 +101,7 @@ struct auth_request { 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;