changeset 8765:d69763bee853 HEAD

auth workers: Return plaintext credentials to parent process if possible, so it gets cached instead of some other scheme.
author Timo Sirainen <tss@iki.fi>
date Sat, 21 Feb 2009 14:59:33 -0500
parents 90e2a21a4298
children 888f57b1bf9c
files src/auth/auth-request.h src/auth/auth-worker-client.c src/auth/passdb.c
diffstat 3 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
 	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;
--- 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 @@
 		return;
 	}
 
+	auth_request->prefer_plain_credentials = TRUE;
 	auth_request->passdb->passdb->iface.
 		lookup_credentials(auth_request, lookup_credentials_callback);
 }
--- 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
@@ -55,6 +55,13 @@
 	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) {