]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth workers: Return plaintext credentials to parent process if possible, so it gets...
authorTimo Sirainen <tss@iki.fi>
Sat, 21 Feb 2009 19:59:33 +0000 (14:59 -0500)
committerTimo Sirainen <tss@iki.fi>
Sat, 21 Feb 2009 19:59:33 +0000 (14:59 -0500)
--HG--
branch : HEAD

src/auth/auth-request.h
src/auth/auth-worker-client.c
src/auth/passdb.c

index 659db8153770f26a7f5b4627384342ed157ae300..52dc278b159b4a3a2cb41b5bff151a880451cdc2 100644 (file)
@@ -89,6 +89,7 @@ struct auth_request {
        unsigned int no_login:1;
        unsigned int no_password:1;
        unsigned int skip_password_check:1;
+       unsigned int prefer_plain_credentials:1;
        unsigned int proxy:1;
        unsigned int proxy_maybe:1;
        unsigned int valid_client_cert:1;
index 2991e2cf859005e34e9ab74f79c272f03f5a41b7..559db4b809de1465fe03fc388404ab230e79779d 100644 (file)
@@ -265,6 +265,7 @@ auth_worker_handle_passl(struct auth_worker_client *client,
                return;
        }
 
+       auth_request->prefer_plain_credentials = TRUE;
        auth_request->passdb->passdb->iface.
                lookup_credentials(auth_request, lookup_credentials_callback);
 }
index f67762ca52be82c3f0f011eb762b2d92eafc7668..794b55760e138215797ac2ea3c0f468a4b844c73 100644 (file)
@@ -55,6 +55,13 @@ bool passdb_get_credentials(struct auth_request *auth_request,
        const char *plaintext;
        int ret;
 
+       if (auth_request->prefer_plain_credentials &&
+           password_scheme_is_alias(input_scheme, "PLAIN")) {
+               /* we've a plaintext scheme and we prefer to get it instead
+                  of converting it to the fallback scheme */
+               wanted_scheme = "";
+       }
+
        ret = password_decode(input, input_scheme, credentials_r, size_r);
        if (ret <= 0) {
                if (ret < 0) {