From: Timo Sirainen Date: Sat, 21 Feb 2009 19:59:33 +0000 (-0500) Subject: auth workers: Return plaintext credentials to parent process if possible, so it gets... X-Git-Tag: 1.2.beta2~66 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=430c0b0c370bebeeceba2e206be76bc134742f41;p=thirdparty%2Fdovecot%2Fcore.git auth workers: Return plaintext credentials to parent process if possible, so it gets cached instead of some other scheme. --HG-- branch : HEAD --- diff --git a/src/auth/auth-request.h b/src/auth/auth-request.h index 659db81537..52dc278b15 100644 --- a/src/auth/auth-request.h +++ b/src/auth/auth-request.h @@ -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; diff --git a/src/auth/auth-worker-client.c b/src/auth/auth-worker-client.c index 2991e2cf85..559db4b809 100644 --- a/src/auth/auth-worker-client.c +++ b/src/auth/auth-worker-client.c @@ -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); } diff --git a/src/auth/passdb.c b/src/auth/passdb.c index f67762ca52..794b55760e 100644 --- a/src/auth/passdb.c +++ b/src/auth/passdb.c @@ -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) {