[dovecot-cvs] dovecot/src/auth auth-request.c, 1.58.2.23, 1.58.2.24 passdb-cache.c, 1.17.2.2, 1.17.2.3 passdb.c, 1.42.2.3, 1.42.2.4

tss at dovecot.org tss at dovecot.org
Thu Feb 15 11:51:33 UTC 2007


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

Modified Files:
      Tag: branch_1_0
	auth-request.c passdb-cache.c passdb.c 
Log Message:
If looking up credentials for NULL passwords, return "scheme not available"
instead of assert-crashing.



Index: auth-request.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-request.c,v
retrieving revision 1.58.2.23
retrieving revision 1.58.2.24
diff -u -d -r1.58.2.23 -r1.58.2.24
--- auth-request.c	15 Feb 2007 11:06:32 -0000	1.58.2.23
+++ auth-request.c	15 Feb 2007 11:51:31 -0000	1.58.2.24
@@ -489,8 +489,6 @@
 			password = result != PASSDB_RESULT_OK ? NULL :
 				passdb_get_credentials(request, password,
 						       scheme);
-			if (password == NULL && result == PASSDB_RESULT_OK)
-				result = PASSDB_RESULT_SCHEME_NOT_AVAILABLE;
 		}
 	}
 

Index: passdb-cache.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb-cache.c,v
retrieving revision 1.17.2.2
retrieving revision 1.17.2.3
diff -u -d -r1.17.2.2 -r1.17.2.3
--- passdb-cache.c	15 Feb 2007 10:31:16 -0000	1.17.2.2
+++ passdb-cache.c	15 Feb 2007 11:51:31 -0000	1.17.2.3
@@ -116,7 +116,12 @@
 	*result_r = PASSDB_RESULT_OK;
 	*password_r = list[0];
 	*scheme_r = password_get_scheme(password_r);
-	i_assert(*scheme_r != NULL);
+	i_assert(*scheme_r != NULL || *password_r == '\0');
+
+	if (*password_r == '\0') {
+		*password_r = NULL;
+		*result_r = PASSDB_RESULT_SCHEME_NOT_AVAILABLE;
+	}
 	return TRUE;
 }
 

Index: passdb.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb.c,v
retrieving revision 1.42.2.3
retrieving revision 1.42.2.4
diff -u -d -r1.42.2.3 -r1.42.2.4
--- passdb.c	21 Dec 2006 15:46:28 -0000	1.42.2.3
+++ passdb.c	15 Feb 2007 11:51:31 -0000	1.42.2.4
@@ -123,9 +123,9 @@
 		callback(result, NULL, auth_request);
 		return;
 	}
-	i_assert(password != NULL);
 
-	password = passdb_get_credentials(auth_request, password, scheme);
+	password = password == NULL ? NULL :
+		passdb_get_credentials(auth_request, password, scheme);
 	if (password == NULL)
 		result = PASSDB_RESULT_SCHEME_NOT_AVAILABLE;
 	callback(result, password, auth_request);



More information about the dovecot-cvs mailing list