summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2015-01-26 14:45:48 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2015-01-26 14:45:48 (GMT)
commit64b744997ef399809dc4c78ec45ddfbebde3e597 (patch)
treede006a73e0bed81071349772a342962935277a0e
parent50a6d86520b2c45a70a3d0e2d19fde37c49d8c90 (diff)
downloadbusybox-master.tar.gz
busybox-master.tar.bz2
ftpd: prevent zombies. closes 7832HEADmaster
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/ftpd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/networking/ftpd.c b/networking/ftpd.c
index 6adcb1d..0c10e1f 100644
--- a/networking/ftpd.c
+++ b/networking/ftpd.c
@@ -1174,8 +1174,13 @@ int ftpd_main(int argc UNUSED_PARAM, char **argv)
//umask(077); - admin can set umask before starting us
- /* Signals. We'll always take -EPIPE rather than a rude signal, thanks */
- signal(SIGPIPE, SIG_IGN);
+ /* Signals */
+ bb_signals(0
+ /* We'll always take EPIPE rather than a rude signal, thanks */
+ + (1 << SIGPIPE)
+ /* LIST command spawns chilren. Prevent zombies */
+ + (1 << SIGCHLD)
+ , SIG_IGN);
/* Set up options on the command socket (do we need these all? why?) */
setsockopt(STDIN_FILENO, IPPROTO_TCP, TCP_NODELAY, &const_int_1, sizeof(const_int_1));