bugfix: chdir(/) after chroot

Fix the famous chdir(".") vs chdir("/") after chroot(something).
This commit is contained in:
Michael Tokarev 2009-05-18 16:53:08 +04:00 committed by Guus Sliepen
parent 6be5d4f5b6
commit d4f9863635

View file

@ -465,7 +465,7 @@ static bool drop_privs() {
}
if (do_chroot) {
tzset(); /* for proper timestamps in logs */
if (chroot(confbase) != 0 || chdir(".") != 0) {
if (chroot(confbase) != 0 || chdir("/") != 0) {
logger(LOG_ERR, _("%s failed"), "chroot()");
return false;
}