[dovecot-cvs] dovecot/src/auth auth-worker-client.c,1.30,1.31

tss at dovecot.org tss at dovecot.org
Fri Feb 16 12:08:34 UTC 2007


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

Modified Files:
	auth-worker-client.c 
Log Message:
Blocking passdbs didn't work as masterdbs.



Index: auth-worker-client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-worker-client.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- auth-worker-client.c	16 Dec 2006 13:37:32 -0000	1.30
+++ auth-worker-client.c	16 Feb 2007 12:08:32 -0000	1.31
@@ -116,6 +116,7 @@
 {
 	/* verify plaintext password */
 	struct auth_request *auth_request;
+        struct auth_passdb *passdb;
 	const char *password;
 	unsigned int passdb_id;
 
@@ -141,16 +142,25 @@
 		return;
 	}
 
-	while (auth_request->passdb->id != passdb_id) {
-		auth_request->passdb = auth_request->passdb->next;
-		if (auth_request->passdb == NULL) {
+	passdb = auth_request->passdb;
+	while (passdb != NULL && passdb->id != passdb_id)
+		passdb = passdb->next;
+
+	if (passdb == NULL) {
+		/* could be a masterdb */
+		passdb = auth_request->auth->masterdbs;
+		while (passdb != NULL && passdb->id != passdb_id)
+			passdb = passdb->next;
+
+		if (passdb == NULL) {
 			i_error("BUG: PASSV had invalid passdb ID");
 			auth_request_unref(&auth_request);
 			return;
 		}
 	}
 
-	auth_request->passdb->passdb->iface.
+	auth_request->passdb = passdb;
+	passdb->passdb->iface.
 		verify_plain(auth_request, password, verify_plain_callback);
 }
 



More information about the dovecot-cvs mailing list