dovecot-2.1: director: Moved all i_fatal()s to preinit stage.

dovecot at dovecot.org dovecot at dovecot.org
Sat Nov 19 23:42:16 EET 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/5ce2123d24ed
changeset: 13738:5ce2123d24ed
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Nov 19 23:41:50 2011 +0200
description:
director: Moved all i_fatal()s to preinit stage.
This avoids a wrongly configured director process from rapidly respawning.

diffstat:

 src/director/main.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (33 lines):

diff -r ffb2993c99cf -r 5ce2123d24ed src/director/main.c
--- a/src/director/main.c	Sat Nov 19 23:41:17 2011 +0200
+++ b/src/director/main.c	Sat Nov 19 23:41:50 2011 +0200
@@ -140,12 +140,15 @@
 		timeout_remove(&dir->to_request);
 }
 
-static void main_init(void)
+static void main_preinit(void)
 {
 	const struct director_settings *set;
 	struct ip_addr listen_ip;
 	unsigned int listen_port;
 
+	restrict_access_by_env(NULL, FALSE);
+	restrict_access_allow_coredumps(TRUE);
+
 	set = master_service_settings_get_others(master_service)[0];
 
 	auth_socket_path = i_strconcat(set->base_dir,
@@ -215,11 +218,8 @@
 
 	master_service_init_log(master_service, "director: ");
 
-	restrict_access_by_env(NULL, FALSE);
-	restrict_access_allow_coredumps(TRUE);
+	main_preinit();
 	master_service_init_finish(master_service);
-
-	main_init();
 	director->test_port = test_port;
 	director->debug = debug;
 	director_connect(director);


More information about the dovecot-cvs mailing list