diff --git a/NEWS b/NEWS index a61e48c5..805c797f 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,7 @@ NEWS * Fix unused function webdav_lockdiscovery in mod_webdav * cmake: Fix crypt lib check * cmake: Add -export-dynamic to link flags, fixes build on FreeBSD + * Set FD_CLOEXEC for bound sockets before pipe-logger forks (fixes #2026) - 1.4.23 - 2009-06-19 * Added some extra warning options in cmake and fix the resulting warnings (unused/static functions) diff --git a/src/network.c b/src/network.c index e2d5f0b9..40901041 100644 --- a/src/network.c +++ b/src/network.c @@ -167,6 +167,11 @@ static int network_server_init(server *srv, buffer *host_token, specific_config } } +#ifdef FD_CLOEXEC + /* set FD_CLOEXEC now, fdevent_fcntl_set is called later; needed for pipe-logger forks */ + fcntl(srv_socket->fd, F_SETFD, FD_CLOEXEC); +#endif + /* */ srv->cur_fds = srv_socket->fd;