projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
27c290f
)
ftpd: do not use root_fd if we are not in chroot
author
Denys Vlasenko
<vda.linux@googlemail.com>
Fri, 27 Jun 2014 11:53:35 +0000
(13:53 +0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Fri, 27 Jun 2014 11:53:35 +0000
(13:53 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/ftpd.c
patch
|
blob
|
history
diff --git
a/networking/ftpd.c
b/networking/ftpd.c
index e7cf5f43158a8ef15e65bd6ec457689a1bcb278d..2d2a3a44cfe2dc3732ffd7e8860b5630981e4aaf 100644
(file)
--- 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]);
}