[dovecot-cvs] dovecot/src/master login-process.c, 1.92, 1.93 master-login-interface.h, 1.9, 1.10

tss at dovecot.org tss at dovecot.org
Thu May 17 16:58:57 EEST 2007


Update of /var/lib/cvs/dovecot/src/master
In directory talvi:/tmp/cvs-serv11159/master

Modified Files:
	login-process.c master-login-interface.h 
Log Message:
Moved SSL listen fd to 4. stdout is now redirected to log.



Index: login-process.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/master/login-process.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- login-process.c	18 Mar 2007 02:00:59 -0000	1.92
+++ login-process.c	17 May 2007 13:58:55 -0000	1.93
@@ -597,7 +597,7 @@
 
 	max_log_lines_per_sec =
 		group->set->login_process_per_connection ? 10 : 0;
-	log_fd = log_create_pipe(&log, max_log_lines_per_sec);
+	log_fd = log_create_pipe(&log, /*max_log_lines_per_sec*/0);
 	if (log_fd < 0)
 		pid = -1;
 	else {
@@ -646,9 +646,15 @@
 		i_fatal("dup2(master) failed: %m");
 	fd_close_on_exec(LOGIN_MASTER_SOCKET_FD, FALSE);
 
-	if (dup2(log_fd, 2) < 0)
+	if (dup2(log_fd, STDERR_FILENO) < 0)
 		i_fatal("dup2(stderr) failed: %m");
-	fd_close_on_exec(2, FALSE);
+	fd_close_on_exec(STDERR_FILENO, FALSE);
+
+	/* redirect writes to stdout also to error log. For example OpenSSL
+	   can be made to log its debug messages to stdout. */
+	if (dup2(log_fd, STDOUT_FILENO) < 0)
+		i_fatal("dup2(stdout) failed: %m");
+	fd_close_on_exec(STDOUT_FILENO, FALSE);
 
 	(void)close(fd[0]);
 	(void)close(fd[1]);

Index: master-login-interface.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/master/master-login-interface.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- master-login-interface.h	11 Oct 2006 12:17:27 -0000	1.9
+++ master-login-interface.h	17 May 2007 13:58:55 -0000	1.10
@@ -4,7 +4,7 @@
 #include "network.h"
 
 #define LOGIN_LISTEN_FD 0
-#define LOGIN_SSL_LISTEN_FD 1
+#define LOGIN_SSL_LISTEN_FD 4
 #define LOGIN_MASTER_SOCKET_FD 3
 
 /* Increase the version number every time master_login_request



More information about the dovecot-cvs mailing list