summaryrefslogtreecommitdiff
path: root/package/busybox/busybox-1.19.2/busybox-1.19.2-inetd.patch
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2011-09-11 22:36:36 +0200
committerPeter Korsgaard <jacmet@sunsite.dk>2011-09-11 22:36:36 +0200
commitd97542c6d88d2e621db8d01db523baac5bf9ccf0 (patch)
tree37aee1fa6c98a4c8f7b671d13e8b50dbbca579c0 /package/busybox/busybox-1.19.2/busybox-1.19.2-inetd.patch
parent95951797b5a2d15c3c92f7f02aad0711aea57ffc (diff)
busybox: add 1.19.2 fixes for chpasswd, crond and inetd.
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/busybox/busybox-1.19.2/busybox-1.19.2-inetd.patch')
-rw-r--r--package/busybox/busybox-1.19.2/busybox-1.19.2-inetd.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/package/busybox/busybox-1.19.2/busybox-1.19.2-inetd.patch b/package/busybox/busybox-1.19.2/busybox-1.19.2-inetd.patch
new file mode 100644
index 000000000..e1395a6b3
--- /dev/null
+++ b/package/busybox/busybox-1.19.2/busybox-1.19.2-inetd.patch
@@ -0,0 +1,47 @@
+--- busybox-1.19.2/networking/inetd.c
++++ busybox-1.19.2-inetd/networking/inetd.c
+@@ -1278,6 +1278,7 @@ int inetd_main(int argc UNUSED_PARAM, ch
+ sep->se_count = 0;
+ rearm_alarm(); /* will revive it in RETRYTIME sec */
+ restore_sigmask(&omask);
++ maybe_close(new_udp_fd);
+ maybe_close(accepted_fd);
+ continue; /* -> check next fd in fd set */
+ }
+@@ -1298,17 +1299,18 @@ int inetd_main(int argc UNUSED_PARAM, ch
+ bb_perror_msg("vfork"+1);
+ sleep(1);
+ restore_sigmask(&omask);
++ maybe_close(new_udp_fd);
+ maybe_close(accepted_fd);
+ continue; /* -> check next fd in fd set */
+ }
+ if (pid == 0)
+ pid--; /* -1: "we did fork and we are child" */
+ }
+- /* if pid == 0 here, we never forked */
++ /* if pid == 0 here, we didn't fork */
+
+ if (pid > 0) { /* parent */
+ if (sep->se_wait) {
+- /* tcp wait: we passed listening socket to child,
++ /* wait: we passed socket to child,
+ * will wait for child to terminate */
+ sep->se_wait = pid;
+ remove_fd_from_set(sep->se_fd);
+@@ -1345,9 +1347,13 @@ int inetd_main(int argc UNUSED_PARAM, ch
+ setsid();
+ /* "nowait" udp */
+ if (new_udp_fd >= 0) {
+- len_and_sockaddr *lsa = xzalloc_lsa(sep->se_family);
++ len_and_sockaddr *lsa;
++ int r;
++
++ close(new_udp_fd);
++ lsa = xzalloc_lsa(sep->se_family);
+ /* peek at the packet and remember peer addr */
+- int r = recvfrom(ctrl, NULL, 0, MSG_PEEK|MSG_DONTWAIT,
++ r = recvfrom(ctrl, NULL, 0, MSG_PEEK|MSG_DONTWAIT,
+ &lsa->u.sa, &lsa->len);
+ if (r < 0)
+ goto do_exit1;