dovecot-1.1: auth workers: Return plaintext credentials to paren...

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 21 21:59:56 EET 2009


details:   http://hg.dovecot.org/dovecot-1.1/rev/bb7ac37f78ee
changeset: 8169:bb7ac37f78ee
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 d5f91d1c0322 -r bb7ac37f78ee 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 cert_username:1;
diff -r d5f91d1c0322 -r bb7ac37f78ee 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
@@ -263,6 +263,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 d5f91d1c0322 -r bb7ac37f78ee 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, *username;
 	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