diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-11 08:39:11 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-11 08:39:11 +0000 |
commit | 08126f665d6b8d761da61acd50acaafa49cff79f (patch) | |
tree | 632fc2039d917f9b37bf2852de5c5288e8cdef16 | |
parent | 459a5ad410af51a1a35576d0d32b0fd8859fbb9b (diff) | |
download | busybox-08126f665d6b8d761da61acd50acaafa49cff79f.tar.gz |
hush: close-on-exec interactive_fd
-rw-r--r-- | shell/hush.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/shell/hush.c b/shell/hush.c index 2560d6e97..29807f889 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -3880,6 +3880,7 @@ int hush_main(int argc, char **argv) } debug_printf("interactive_fd=%d\n", interactive_fd); if (interactive_fd) { + fcntl(interactive_fd, F_SETFD, FD_CLOEXEC); /* Looks like they want an interactive shell */ setup_job_control(); /* -1 is special - makes xfuncs longjmp, not exit @@ -3907,8 +3908,9 @@ int hush_main(int argc, char **argv) /* give up */ interactive_fd = 0; } + if (interactive_fd) + fcntl(interactive_fd, F_SETFD, FD_CLOEXEC); } - #endif if (argv[optind] == NULL) { |