dovecot-1.2: auth workers: Return plaintext credentials to paren...
dovecot at dovecot.org
dovecot at dovecot.org
Sat Feb 21 22:02:59 EET 2009
details: http://hg.dovecot.org/dovecot-1.2/rev/d69763bee853
changeset: 8765:d69763bee853
user: Timo Sirainen <tss at iki.fi>
date: Sat Feb 21 14:59:33 2009 -0500
description:
auth workers: Return plaintext credentials to parent process if possible, so it gets cached instead of some other scheme.
diffstat:
3 files changed, 9 insertions(+)
src/auth/auth-request.h | 1 +
src/auth/auth-worker-client.c | 1 +
src/auth/passdb.c | 7 +++++++
diffs (39 lines):
diff -r 90e2a21a4298 -r d69763bee853 src/auth/auth-request.h
--- a/src/auth/auth-request.h Sat Feb 21 14:51:32 2009 -0500
+++ b/src/auth/auth-request.h Sat Feb 21 14:59:33 2009 -0500
@@ -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 -r 90e2a21a4298 -r d69763bee853 src/auth/auth-worker-client.c
--- a/src/auth/auth-worker-client.c Sat Feb 21 14:51:32 2009 -0500
+++ b/src/auth/auth-worker-client.c Sat Feb 21 14:59:33 2009 -0500
@@ -265,6 +265,7 @@ auth_worker_handle_passl(struct auth_wor
return;
}
+ auth_request->prefer_plain_credentials = TRUE;
auth_request->passdb->passdb->iface.
lookup_credentials(auth_request, lookup_credentials_callback);
}
diff -r 90e2a21a4298 -r d69763bee853 src/auth/passdb.c
--- a/src/auth/passdb.c Sat Feb 21 14:51:32 2009 -0500
+++ b/src/auth/passdb.c Sat Feb 21 14:59:33 2009 -0500
@@ -54,6 +54,13 @@ bool passdb_get_credentials(struct auth_
const char *wanted_scheme = auth_request->credentials_scheme;
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) {
More information about the dovecot-cvs
mailing list