summaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko2012-03-08 00:28:24 +0100
committerDenys Vlasenko2012-03-08 00:28:24 +0100
commit0687a5b496a05cbc06f3bcdc517a2e6cabc535df (patch)
tree55aedfacfddad2faafb75c4bee0d98122325df5c /libbb
parent39c2cb2e93e2acc75a5eb6dd91d81f79c787acd5 (diff)
downloadbusybox-0687a5b496a05cbc06f3bcdc517a2e6cabc535df.zip
busybox-0687a5b496a05cbc06f3bcdc517a2e6cabc535df.tar.gz
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 56ee459..d8a42ba 100644
--- a/libbb/xfuncs_printf.c
+++ b/libbb/xfuncs_printf.c
@@ -362,6 +362,7 @@ void FAST_FUNC xchroot(const char *path)
{
if (chroot(path))
bb_perror_msg_and_die("can't change root directory to %s", path);
+ xchdir("/");
}
// Print a warning message if opendir() fails, but don't die.