]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Don't add proxy/pass fields when we're only authenticating (not logging in).
authorTimo Sirainen <tss@iki.fi>
Tue, 2 Oct 2012 21:41:18 +0000 (00:41 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 2 Oct 2012 21:41:18 +0000 (00:41 +0300)
For example SMTP server doesn't need these fields when doing SMTP AUTH.

src/auth/auth-request-handler.c
src/auth/auth-request.c
src/auth/auth-request.h

index ab12defc17575f526a3fe6e7c2472a7f382c9c74..df3f859488fa9ae6bfc2704f0838d7a856e393e7 100644 (file)
@@ -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;
index aaed9b593d3afb67dd553b2c02d8bb3642e08869..1bc5a494bac654563c1ea6f24830efdff48ec609 100644 (file)
@@ -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)
index 59d6315e6deb224ed1ccb5231129a87643dd2e87..673c8d70f51164e86f867419c058d00f41fea5a5 100644 (file)
@@ -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;