From: Michael Tokarev Date: Mon, 18 May 2009 12:53:08 +0000 (+0400) Subject: bugfix: chdir(/) after chroot X-Git-Tag: release-1.0.10~74 X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=commitdiff_plain;h=d4f9863635d06665cfbd3c46dc482344de240e97 bugfix: chdir(/) after chroot Fix the famous chdir(".") vs chdir("/") after chroot(something). --- diff --git a/src/tincd.c b/src/tincd.c index 929e9b91..89bda91b 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -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; }