libbb: make xchroot do a chdir("/") after chroot
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
@ -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.
|
||||
|
Reference in New Issue
Block a user