summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--src/proxsmtpd.c3
2 files changed, 4 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 31bce38..c87253e 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
1.10 ???
- Fix race issue with waitpid on linux.
+ - Close all (other than standard) file descriptors when forking filter.
1.9 [2011-01-23]
- Fix build warnings.
diff --git a/src/proxsmtpd.c b/src/proxsmtpd.c
index 8f50d96..963894d 100644
--- a/src/proxsmtpd.c
+++ b/src/proxsmtpd.c
@@ -425,6 +425,9 @@ static pid_t fork_filter(spctx_t* sp, int* infd, int* outfd, int* errfd)
kill_myself();
}
+ for (r = 3; r < FD_SETSIZE; ++r)
+ close(r);
+
/* All the necessary environment vars */
sp_setup_forked(sp, 1);