summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-06-18 00:41:43 +0000
committerjow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-06-18 00:41:43 +0000
commit0793612583f480c051c9b4c6521a225063c758ab (patch)
tree2bbea2af541e783b6745acc3293026ea83355c46
parenta0b8f9998e1f791304629220a5ff3a084bb856fc (diff)
downloaduhttpd-0793612583f480c051c9b4c6521a225063c758ab.tar.gz
[package] uhttpd: finish inherited uloop in forked childs, fixes misdispatched events leading to race conditions and bad memory accesses
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/package/uhttpd/src@32419 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--uhttpd-cgi.c3
-rw-r--r--uhttpd-lua.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/uhttpd-cgi.c b/uhttpd-cgi.c
index ee1b80c..8336a1b 100644
--- a/uhttpd-cgi.c
+++ b/uhttpd-cgi.c
@@ -365,6 +365,9 @@ bool uh_cgi_request(struct client *cl, struct path_info *pi,
sleep(atoi(getenv("UHTTPD_SLEEP_ON_FORK") ?: "0"));
#endif
+ /* do not leak parent epoll descriptor */
+ uloop_done();
+
/* close loose pipe ends */
close(rfd[0]);
close(wfd[1]);
diff --git a/uhttpd-lua.c b/uhttpd-lua.c
index 0b91b34..5158534 100644
--- a/uhttpd-lua.c
+++ b/uhttpd-lua.c
@@ -397,6 +397,9 @@ bool uh_lua_request(struct client *cl, lua_State *L)
sleep(atoi(getenv("UHTTPD_SLEEP_ON_FORK") ?: "0"));
#endif
+ /* do not leak parent epoll descriptor */
+ uloop_done();
+
/* close loose pipe ends */
close(rfd[0]);
close(wfd[1]);