summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenys Vlasenko2012-03-08 00:28:52 +0100
committerDenys Vlasenko2012-03-08 00:28:52 +0100
commit4e3beb2e1db3d4739a5a924e003938a9815f98e5 (patch)
tree5fbfd5643c5e64dd82852be92bb66c9c9d2245b4 /networking
parent0687a5b496a05cbc06f3bcdc517a2e6cabc535df (diff)
downloadbusybox-4e3beb2e1db3d4739a5a924e003938a9815f98e5.zip
busybox-4e3beb2e1db3d4739a5a924e003938a9815f98e5.tar.gz
tftpd: chroot to DIR, not merely chdir. Closes 4874
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking')
-rw-r--r--networking/tftp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/networking/tftp.c b/networking/tftp.c
index 043b879..ce48a1e 100644
--- a/networking/tftp.c
+++ b/networking/tftp.c
@@ -789,8 +789,9 @@ int tftpd_main(int argc UNUSED_PARAM, char **argv)
openlog(applet_name, LOG_PID, LOG_DAEMON);
logmode = LOGMODE_SYSLOG;
}
- if (argv[0])
- xchdir(argv[0]);
+ if (argv[0]) {
+ xchroot(argv[0]);
+ }
result = recv_from_to(STDIN_FILENO, block_buf, sizeof(block_buf),
0 /* flags */,