[dovecot-cvs] dovecot/src/login-common main.c,1.14,1.15

cras at procontrol.fi cras at procontrol.fi
Mon May 10 19:05:12 EEST 2004


Update of /home/cvs/dovecot/src/login-common
In directory talvi:/tmp/cvs-serv10665/login-common

Modified Files:
	main.c 
Log Message:
Write all logging through master process. Fixes problems with log rotation,
chrooting, etc. Master process also allows max. 10 log messages per second
per child process, it then begins throttling them (eventually making the
child process start blocking on stderr).



Index: main.c
===================================================================
RCS file: /home/cvs/dovecot/src/login-common/main.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- main.c	22 Aug 2003 03:34:04 -0000	1.14
+++ main.c	10 May 2004 16:05:10 -0000	1.15
@@ -121,25 +121,9 @@
                 clients_notify_auth_connected();
 }
 
-static void open_logfile(const char *name)
-{
-	if (getenv("USE_SYSLOG") != NULL)
-		i_set_failure_syslog(name, LOG_NDELAY, LOG_MAIL);
-	else {
-		/* log to file or stderr */
-		i_set_failure_file(getenv("LOGFILE"), name);
-	}
-
-	if (getenv("INFOLOGFILE") != NULL)
-		i_set_info_file(getenv("INFOLOGFILE"));
-
-	i_set_failure_timestamp_format(getenv("LOGSTAMP"));
-}
-
-static void drop_privileges(const char *name)
+static void drop_privileges()
 {
-	/* Log file or syslog opening probably requires roots */
-	open_logfile(name);
+	i_set_failure_internal();
 
 	/* Initialize SSL proxy so it can read certificate and private
 	   key file. */
@@ -259,7 +243,7 @@
 	}
 
 	name = strrchr(argv[0], '/');
-	drop_privileges(name == NULL ? argv[0] : name+1);
+	drop_privileges();
 
 	process_title_init(argv, envp);
 	ioloop = io_loop_create(system_pool);



More information about the dovecot-cvs mailing list