[dovecot-cvs] dovecot/src/auth passdb.c,1.51,1.52

tss at dovecot.org tss at dovecot.org
Wed May 16 23:39:00 EEST 2007


Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv3299

Modified Files:
	passdb.c 
Log Message:
If wanted scheme is "" (userdb static lookup), switch it to the actual
scheme we got. This should make caching work right for those lookups.



Index: passdb.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- passdb.c	13 May 2007 12:17:09 -0000	1.51
+++ passdb.c	16 May 2007 20:38:58 -0000	1.52
@@ -61,13 +61,6 @@
 	const char *plaintext;
 	int ret;
 
-	if (*wanted_scheme == '\0') {
-		/* anything goes */
-		*credentials_r = (const unsigned char *)input;
-		*size_r = strlen(input);
-		return TRUE;
-	}
-
 	ret = password_decode(input, input_scheme, credentials_r, size_r);
 	if (ret <= 0) {
 		if (ret < 0) {
@@ -81,6 +74,14 @@
 		return FALSE;
 	}
 
+	if (*wanted_scheme == '\0') {
+		/* anything goes. change the credentials_scheme to what we
+		   actually got, so blocking passdbs work. */
+		auth_request->credentials_scheme =
+			p_strdup(auth_request->pool, input_scheme);
+		return TRUE;
+	}
+
 	if (!password_scheme_is_alias(input_scheme, wanted_scheme)) {
 		if (!password_scheme_is_alias(input_scheme, "PLAIN")) {
 			auth_request_log_info(auth_request, "password",



More information about the dovecot-cvs mailing list