aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2012-03-08 00:28:24 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2012-03-08 00:28:24 +0100
commit0687a5b496a05cbc06f3bcdc517a2e6cabc535df (patch)
tree55aedfacfddad2faafb75c4bee0d98122325df5c /libbb
parent39c2cb2e93e2acc75a5eb6dd91d81f79c787acd5 (diff)
downloadbusybox-w32-0687a5b496a05cbc06f3bcdc517a2e6cabc535df.tar.gz
busybox-w32-0687a5b496a05cbc06f3bcdc517a2e6cabc535df.tar.bz2
busybox-w32-0687a5b496a05cbc06f3bcdc517a2e6cabc535df.zip
libbb: make xchroot do a chdir("/") after chroot
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/xfuncs_printf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c
index 56ee459e4..d8a42ba0b 100644
--- a/libbb/xfuncs_printf.c
+++ b/libbb/xfuncs_printf.c
@@ -362,6 +362,7 @@ void FAST_FUNC xchroot(const char *path)
362{ 362{
363 if (chroot(path)) 363 if (chroot(path))
364 bb_perror_msg_and_die("can't change root directory to %s", path); 364 bb_perror_msg_and_die("can't change root directory to %s", path);
365 xchdir("/");
365} 366}
366 367
367// Print a warning message if opendir() fails, but don't die. 368// Print a warning message if opendir() fails, but don't die.