Mercurial > dovecot > original-hg > dovecot-1.2
changeset 5632:2ed5abe3aaef HEAD
Moved SSL listen fd to 4. stdout is now redirected to log.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 17 May 2007 16:58:55 +0300 |
parents | 139416ee311e |
children | fbb4bdbbf374 |
files | src/login-common/main.c src/master/login-process.c src/master/master-login-interface.h |
diffstat | 3 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/login-common/main.c Wed May 16 23:38:58 2007 +0300 +++ b/src/login-common/main.c Thu May 17 16:58:55 2007 +0300 @@ -370,7 +370,7 @@ #ifdef DEBUG if (!is_inetd && getenv("GDB") == NULL) - fd_debug_verify_leaks(4, 1024); + fd_debug_verify_leaks(5, 1024); #endif /* clear all allocated memory before freeing it. this makes the login processes pretty safe to reuse for new connections since the
--- a/src/master/login-process.c Wed May 16 23:38:58 2007 +0300 +++ b/src/master/login-process.c Thu May 17 16:58:55 2007 +0300 @@ -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]);
--- a/src/master/master-login-interface.h Wed May 16 23:38:58 2007 +0300 +++ b/src/master/master-login-interface.h Thu May 17 16:58:55 2007 +0300 @@ -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