[dovecot-cvs] dovecot/src/auth auth-worker-client.c, 1.25, 1.26 passdb-blocking.c, 1.11, 1.12

tss at dovecot.org tss at dovecot.org
Tue Oct 17 12:26:46 UTC 2006


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

Modified Files:
	auth-worker-client.c passdb-blocking.c 
Log Message:
Fixes to handling blocking passdb (ie. MySQL) failures. It ignored any
non-password related checks, such as allow_nets.



Index: auth-worker-client.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/auth-worker-client.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- auth-worker-client.c	5 May 2006 14:53:34 -0000	1.25
+++ auth-worker-client.c	17 Oct 2006 11:26:43 -0000	1.26
@@ -78,6 +78,9 @@
 	struct auth_worker_client *client = request->context;
 	string_t *str;
 
+	if (request->passdb_failure && result == PASSDB_RESULT_OK)
+		result = PASSDB_RESULT_PASSWORD_MISMATCH;
+
 	str = t_str_new(64);
 	str_printfa(str, "%u\t", request->id);
 
@@ -158,6 +161,9 @@
 	struct auth_worker_client *client = request->context;
 	string_t *str;
 
+	if (request->passdb_failure && result == PASSDB_RESULT_OK)
+		result = PASSDB_RESULT_PASSWORD_MISMATCH;
+
 	str = t_str_new(64);
 	str_printfa(str, "%u\t", request->id);
 

Index: passdb-blocking.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/passdb-blocking.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- passdb-blocking.c	15 Oct 2006 20:55:12 -0000	1.11
+++ passdb-blocking.c	17 Oct 2006 11:26:43 -0000	1.12
@@ -110,7 +110,7 @@
 	const char *password, *scheme;
 
 	result = check_failure(request, &reply);
-	if (result >= 0) {
+	if (result > 0) {
 		if (get_pass_reply(request, reply, &password, &scheme) < 0)
 			result = PASSDB_RESULT_INTERNAL_FAILURE;
 	}
@@ -137,10 +137,10 @@
 lookup_credentials_callback(struct auth_request *request, const char *reply)
 {
 	enum passdb_result result;
-	const char *password, *scheme;
+	const char *password = NULL, *scheme = NULL;
 
 	result = check_failure(request, &reply);
-	if (result >= 0) {
+	if (result > 0) {
 		if (get_pass_reply(request, reply, &password, &scheme) < 0)
 			result = PASSDB_RESULT_INTERNAL_FAILURE;
 	}



More information about the dovecot-cvs mailing list