[dovecot-cvs] dovecot/src/auth main.c,1.27,1.28

cras at dovecot.org cras at dovecot.org
Sat Aug 28 23:08:17 EEST 2004


Update of /home/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv32348

Modified Files:
	main.c 
Log Message:
Initialize userdb/passdb/password schemes before dropping privileges.



Index: main.c
===================================================================
RCS file: /home/cvs/dovecot/src/auth/main.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- main.c	23 Jun 2004 17:50:44 -0000	1.27
+++ main.c	28 Aug 2004 20:08:14 -0000	1.28
@@ -58,6 +58,9 @@
 {
 	unsigned int seed;
 
+	verbose = getenv("VERBOSE") != NULL;
+	verbose_debug = getenv("VERBOSE_DEBUG") != NULL;
+
 	open_logfile();
 
 	/* Open /dev/urandom before chrooting */
@@ -65,6 +68,12 @@
 	random_fill(&seed, sizeof(seed));
 	srand(seed);
 
+	/* Initialize databases so their configuration files can be readable
+	   only by root. Also load all modules here. */
+	userdb_init();
+	passdb_init();
+        password_schemes_init();
+
 	/* Password lookups etc. may require roots, allow it. */
 	restrict_access_by_env(FALSE);
 }
@@ -190,14 +199,7 @@
 	unsigned int pid;
 
 	lib_init_signals(sig_quit);
-
-	verbose = getenv("VERBOSE") != NULL;
-	verbose_debug = getenv("VERBOSE_DEBUG") != NULL;
-
 	mech_init();
-	userdb_init();
-	passdb_init();
-        password_schemes_init();
 
 	masters_buf = buffer_create_dynamic(default_pool, 64, (size_t)-1);
 



More information about the dovecot-cvs mailing list