dovecot-2.0: script-login: Close extra fds to avoid failing with...
dovecot at dovecot.org
dovecot at dovecot.org
Tue Dec 20 14:39:52 EET 2011
details: http://hg.dovecot.org/dovecot-2.0/rev/728c54eade74
changeset: 13004:728c54eade74
user: Timo Sirainen <tss at iki.fi>
date: Tue Dec 20 14:39:56 2011 +0200
description:
script-login: Close extra fds to avoid failing with --enable-devel-checks.
diffstat:
src/util/script-login.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diffs (17 lines):
diff -r 4016e43d648f -r 728c54eade74 src/util/script-login.c
--- a/src/util/script-login.c Tue Dec 20 13:16:55 2011 +0200
+++ b/src/util/script-login.c Tue Dec 20 14:39:56 2011 +0200
@@ -126,9 +126,13 @@
i_fatal("dup2() failed: %m");
if (dup2(fd, STDOUT_FILENO) < 0)
i_fatal("dup2() failed: %m");
+ if (close(fd) < 0)
+ i_fatal("close() failed: %m");
if (conn->fd != SCRIPT_COMM_FD) {
if (dup2(conn->fd, SCRIPT_COMM_FD) < 0)
i_fatal("dup2() failed: %m");
+ if (close(conn->fd) < 0)
+ i_fatal("close() failed: %m");
}
/* close all listener sockets */
More information about the dovecot-cvs
mailing list