dovecot-2.0: auth: Fixed crash at deinit.

dovecot at dovecot.org dovecot at dovecot.org
Sun Mar 14 15:09:51 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/4ca5dfd58d47
changeset: 10908:4ca5dfd58d47
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Mar 14 15:09:14 2010 +0200
description:
auth: Fixed crash at deinit.

diffstat:

 src/auth/auth.c         |  15 ---------------
 src/auth/main.c         |  11 +++++++++--
 src/auth/passdb-cache.h |   1 +
 3 files changed, 10 insertions(+), 17 deletions(-)

diffs (91 lines):

diff -r 3f43b5c47a0e -r 4ca5dfd58d47 src/auth/auth.c
--- a/src/auth/auth.c	Sun Mar 14 15:02:28 2010 +0200
+++ b/src/auth/auth.c	Sun Mar 14 15:09:14 2010 +0200
@@ -1,19 +1,11 @@
 /* Copyright (c) 2005-2010 Dovecot authors, see the included COPYING file */
 
 #include "auth-common.h"
-#include "network.h"
 #include "array.h"
-#include "str.h"
-#include "env-util.h"
 #include "mech.h"
 #include "userdb.h"
 #include "passdb.h"
-#include "passdb-cache.h"
 #include "auth.h"
-#include "auth-request-handler.h"
-
-#include <stdlib.h>
-#include <unistd.h>
 
 struct auth_userdb_settings userdb_dummy_set = {
 	.driver = "static",
@@ -204,10 +196,6 @@
 	for (userdb = auth->userdbs; userdb != NULL; userdb = userdb->next)
 		userdb_init(userdb->userdb);
 
-	/* caching is handled only by the main auth process */
-	if (!worker)
-		passdb_cache_init(auth->set);
-
 	auth_mech_list_verify_passdb(auth);
 }
 
@@ -226,9 +214,6 @@
 	for (userdb = auth->userdbs; userdb != NULL; userdb = userdb->next)
 		userdb_deinit(userdb->userdb);
 
-	auth_request_handler_deinit();
-	passdb_cache_deinit();
-
 	pool_unref(&auth->pool);
 }
 
diff -r 3f43b5c47a0e -r 4ca5dfd58d47 src/auth/main.c
--- a/src/auth/main.c	Sun Mar 14 15:02:28 2010 +0200
+++ b/src/auth/main.c	Sun Mar 14 15:09:14 2010 +0200
@@ -13,6 +13,7 @@
 #include "master-service.h"
 #include "master-interface.h"
 #include "password-scheme.h"
+#include "passdb-cache.h"
 #include "mech.h"
 #include "auth.h"
 #include "auth-penalty.h"
@@ -97,6 +98,9 @@
 		/* workers have only a single connection from the master
 		   auth process */
 		master_service_set_client_limit(master_service, 1);
+	} else {
+		/* caching is handled only by the main auth process */
+		passdb_cache_init(global_auth_settings);
 	}
 }
 
@@ -111,9 +115,12 @@
 	auth_master_connections_deinit();
         auth_worker_server_deinit();
 
+	auths_deinit();
+	auth_request_handler_deinit();
+	passdb_cache_deinit();
+
+	mech_register_deinit(&mech_reg);
 	mech_deinit(global_auth_settings);
-	auths_deinit();
-	mech_register_deinit(&mech_reg);
 	auth_penalty_deinit(&auth_penalty);
 
 	/* allow modules to unregister their dbs/drivers/etc. before freeing
diff -r 3f43b5c47a0e -r 4ca5dfd58d47 src/auth/passdb-cache.h
--- a/src/auth/passdb-cache.h	Sun Mar 14 15:02:28 2010 +0200
+++ b/src/auth/passdb-cache.h	Sun Mar 14 15:09:14 2010 +0200
@@ -3,6 +3,7 @@
 
 #include "auth-cache.h"
 
+enum passdb_result;
 extern struct auth_cache *passdb_cache;
 
 bool passdb_cache_verify_plain(struct auth_request *request, const char *key,


More information about the dovecot-cvs mailing list