From a22b126f09c7a75ae6a29149f2209fea7b3c450a Mon Sep 17 00:00:00 2001 From: stbuehler Date: Fri, 4 Mar 2016 18:54:30 +0000 Subject: [mod_cgi] kill CGI if fail to write request body (clean up potential zombie processes from unreaped children) From: Glenn Strauss git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3092 152afb58-edef-0310-8abb-c4023f1b3aa9 --- NEWS | 1 + src/mod_cgi.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 6d7ac16d..e0e2ed80 100644 --- a/NEWS +++ b/NEWS @@ -22,6 +22,7 @@ NEWS * [mod_cgi] send 500 if CGI ends and there is no response (fixes #2542) * [mod_cgi] consolidate CGI cleanup code * [mod_cgi] simplify mod_cgi_handle_subrequest() + * [mod_cgi] kill CGI if fail to write request body - 1.4.39 - 2016-01-02 * [core] fix memset_s call (fixes #2698) diff --git a/src/mod_cgi.c b/src/mod_cgi.c index 78af02ba..d3e02975 100644 --- a/src/mod_cgi.c +++ b/src/mod_cgi.c @@ -1153,6 +1153,8 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer * /* fatal error */ close(from_cgi_fds[0]); close(to_cgi_fds[1]); + kill(pid, SIGTERM); + cgi_pid_add(srv, p, pid); return -1; case -2: /* connection reset */ -- cgit v1.2.1