diff options
author | Denys Vlasenko | 2014-06-27 13:53:35 +0200 |
---|---|---|
committer | Denys Vlasenko | 2014-06-27 13:53:35 +0200 |
commit | 9d7cbdeee3545d36db201a2d822cd2bd10074add (patch) | |
tree | fcfe36089e7130c3e3b3f21d96d6abd176c8e9fd /networking | |
parent | 27c290f7f29fc57385d53893bfd7301db4708e9c (diff) | |
download | busybox-9d7cbdeee3545d36db201a2d822cd2bd10074add.zip busybox-9d7cbdeee3545d36db201a2d822cd2bd10074add.tar.gz |
ftpd: do not use root_fd if we are not in chroot
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r-- | networking/ftpd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/networking/ftpd.c b/networking/ftpd.c index e7cf5f4..2d2a3a4 100644 --- a/networking/ftpd.c +++ b/networking/ftpd.c @@ -1173,11 +1173,14 @@ int ftpd_main(int argc UNUSED_PARAM, char **argv) applet_name = xasprintf("%s[%u]", applet_name, (int)getpid()); #if !BB_MMU - G.root_fd = xopen("/", O_RDONLY | O_DIRECTORY); - close_on_exec_on(G.root_fd); + G.root_fd = -1; #endif argv += optind; if (argv[0]) { +#if !BB_MMU + G.root_fd = xopen("/", O_RDONLY | O_DIRECTORY); + close_on_exec_on(G.root_fd); +#endif xchroot(argv[0]); } |