[dovecot-cvs] dovecot/src/auth auth-worker-client.c, 1.25, 1.25.2.1 passdb-blocking.c, 1.10.2.1, 1.10.2.2

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


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

Modified Files:
      Tag: branch_1_0
	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.25.2.1
diff -u -d -r1.25 -r1.25.2.1
--- auth-worker-client.c	5 May 2006 14:53:34 -0000	1.25
+++ auth-worker-client.c	17 Oct 2006 11:26:41 -0000	1.25.2.1
@@ -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.10.2.1
retrieving revision 1.10.2.2
diff -u -d -r1.10.2.1 -r1.10.2.2
--- passdb-blocking.c	15 Oct 2006 20:55:11 -0000	1.10.2.1
+++ passdb-blocking.c	17 Oct 2006 11:26:41 -0000	1.10.2.2
@@ -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