Use filedescriptor 0 for mod_scgi spawn socket, redirect STDERR to /dev/null (#1716)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2257 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.20
Stefan Bühler 15 years ago
parent c1662bcf8a
commit 60b90dad70

@ -40,6 +40,7 @@ NEWS
* Handle only HEAD, GET and POST in mod_dirlisting (same as in staticfile) (#1687)
* fixed mod_secdownload problem with unsigned time_t (#1688)
* handle EAGAIN and EINTR for freebsd sendfile (#1675)
* Use filedescriptor 0 for mod_scgi spawn socket, redirect STDERR to /dev/null (#1716)
- 1.4.19 - 2008-03-10

@ -759,11 +759,20 @@ static int scgi_spawn_connection(server *srv,
env.size = 0;
env.used = 0;
if (scgi_fd != 0) {
close(0);
dup2(scgi_fd, 0);
close(scgi_fd);
scgi_fd = 0;
}
/* we don't need the client socket */
for (fd = 3; fd < 256; fd++) {
if (fd != 2 && fd != scgi_fd) close(fd);
close(fd);
}
openDevNull(STDERR_FILENO);
/* build clean environment */
if (host->bin_env_copy->used) {
for (i = 0; i < host->bin_env_copy->used; i++) {

Loading…
Cancel
Save