[git commit] tftpd: chroot to DIR, not merely chdir. Closes 4874

Denys Vlasenko vda.linux at googlemail.com
Wed Mar 7 23:28:52 UTC 2012


commit: http://git.busybox.net/busybox/commit/?id=4e3beb2e1db3d4739a5a924e003938a9815f98e5
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 networking/tftp.c |    5 +++--
 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 */,


More information about the busybox-cvs mailing list