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 /shell | |
| parent | 459a5ad410af51a1a35576d0d32b0fd8859fbb9b (diff) | |
| download | busybox-w32-08126f665d6b8d761da61acd50acaafa49cff79f.tar.gz busybox-w32-08126f665d6b8d761da61acd50acaafa49cff79f.tar.bz2 busybox-w32-08126f665d6b8d761da61acd50acaafa49cff79f.zip | |
hush: close-on-exec interactive_fd
Diffstat (limited to 'shell')
| -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) | |||
| 3880 | } | 3880 | } |
| 3881 | debug_printf("interactive_fd=%d\n", interactive_fd); | 3881 | debug_printf("interactive_fd=%d\n", interactive_fd); |
| 3882 | if (interactive_fd) { | 3882 | if (interactive_fd) { |
| 3883 | fcntl(interactive_fd, F_SETFD, FD_CLOEXEC); | ||
| 3883 | /* Looks like they want an interactive shell */ | 3884 | /* Looks like they want an interactive shell */ |
| 3884 | setup_job_control(); | 3885 | setup_job_control(); |
| 3885 | /* -1 is special - makes xfuncs longjmp, not exit | 3886 | /* -1 is special - makes xfuncs longjmp, not exit |
| @@ -3907,8 +3908,9 @@ int hush_main(int argc, char **argv) | |||
| 3907 | /* give up */ | 3908 | /* give up */ |
| 3908 | interactive_fd = 0; | 3909 | interactive_fd = 0; |
| 3909 | } | 3910 | } |
| 3911 | if (interactive_fd) | ||
| 3912 | fcntl(interactive_fd, F_SETFD, FD_CLOEXEC); | ||
| 3910 | } | 3913 | } |
| 3911 | |||
| 3912 | #endif | 3914 | #endif |
| 3913 | 3915 | ||
| 3914 | if (argv[optind] == NULL) { | 3916 | if (argv[optind] == NULL) { |
