aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-06-18 00:41:43 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-06-18 00:41:43 +0000
commitd787e8414b4ab04ebddbf5d1a5a52278d532c4b3 (patch)
tree365dfc7640dab674eadb79e04569ee00438db113
parent8ddefa0cd3f02b1adaf0a92772f2b4e779929c46 (diff)
downloadupstream-d787e8414b4ab04ebddbf5d1a5a52278d532c4b3.tar.gz
upstream-d787e8414b4ab04ebddbf5d1a5a52278d532c4b3.tar.bz2
upstream-d787e8414b4ab04ebddbf5d1a5a52278d532c4b3.zip
[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@32419 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--package/uhttpd/Makefile2
-rw-r--r--package/uhttpd/src/uhttpd-cgi.c3
-rw-r--r--package/uhttpd/src/uhttpd-lua.c3
3 files changed, 7 insertions, 1 deletions
diff --git a/package/uhttpd/Makefile b/package/uhttpd/Makefile
index 9d8f9fa95d..b8afa0d89f 100644
--- a/package/uhttpd/Makefile
+++ b/package/uhttpd/Makefile
@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=uhttpd
-PKG_RELEASE:=35
+PKG_RELEASE:=36
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
PKG_CONFIG_DEPENDS := \
diff --git a/package/uhttpd/src/uhttpd-cgi.c b/package/uhttpd/src/uhttpd-cgi.c
index ee1b80cc7f..8336a1b71f 100644
--- a/package/uhttpd/src/uhttpd-cgi.c
+++ b/package/uhttpd/src/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/package/uhttpd/src/uhttpd-lua.c b/package/uhttpd/src/uhttpd-lua.c
index 0b91b348f4..5158534e27 100644
--- a/package/uhttpd/src/uhttpd-lua.c
+++ b/package/uhttpd/src/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]);