dovecot-2.0: auth: Abort pending penalty lookups earlier in deinit.

dovecot at dovecot.org dovecot at dovecot.org
Tue Jun 8 22:52:37 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/149d57c1a9c0
changeset: 11501:149d57c1a9c0
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jun 08 20:52:24 2010 +0100
description:
auth: Abort pending penalty lookups earlier in deinit.

diffstat:

 src/auth/auth-request-handler.c |  11 ++++++-----
 src/auth/main.c                 |   3 ++-
 2 files changed, 8 insertions(+), 6 deletions(-)

diffs (55 lines):

diff -r 6f85840f8171 -r 149d57c1a9c0 src/auth/auth-request-handler.c
--- a/src/auth/auth-request-handler.c	Tue Jun 08 20:51:59 2010 +0100
+++ b/src/auth/auth-request-handler.c	Tue Jun 08 20:52:24 2010 +0100
@@ -185,8 +185,10 @@
 	request->delayed_failure = TRUE;
 	handler->refcount++;
 
-	auth_penalty_update(auth_penalty, request,
-			    request->last_penalty + 1);
+	if (auth_penalty != NULL) {
+		auth_penalty_update(auth_penalty, request,
+				    request->last_penalty + 1);
+	}
 
 	auth_request_refresh_last_access(request);
 	aqueue_append(auth_failures, &request);
@@ -221,7 +223,7 @@
 	case AUTH_CLIENT_RESULT_SUCCESS:
 		auth_request_proxy_finish(request, TRUE);
 
-		if (request->last_penalty != 0) {
+		if (request->last_penalty != 0 && auth_penalty != NULL) {
 			/* reset penalty */
 			auth_penalty_update(auth_penalty, request, 0);
 		}
@@ -445,8 +447,7 @@
 	handler->refcount++;
 
 	/* before we start authenticating, see if we need to wait first */
-	auth_penalty_lookup(auth_penalty, request,
-			    auth_penalty_callback);
+	auth_penalty_lookup(auth_penalty, request, auth_penalty_callback);
 	return TRUE;
 }
 
diff -r 6f85840f8171 -r 149d57c1a9c0 src/auth/main.c
--- a/src/auth/main.c	Tue Jun 08 20:51:59 2010 +0100
+++ b/src/auth/main.c	Tue Jun 08 20:52:24 2010 +0100
@@ -151,6 +151,8 @@
 
 static void main_deinit(void)
 {
+	/* cancel all pending anvil penalty lookups */
+	auth_penalty_deinit(&auth_penalty);
 	/* deinit auth workers, which aborts pending requests */
         auth_worker_server_deinit();
 	/* deinit passdbs and userdbs. it aborts any pending async requests. */
@@ -168,7 +170,6 @@
 
 	mech_register_deinit(&mech_reg);
 	mech_deinit(global_auth_settings);
-	auth_penalty_deinit(&auth_penalty);
 
 	/* allow modules to unregister their dbs/drivers/etc. before freeing
 	   the whole data structures containing them. */


More information about the dovecot-cvs mailing list