From: Michael Tokarev Date: Mon, 18 May 2009 12:53:08 +0000 (+0400) Subject: bugfix: chdir(/) after chroot X-Git-Tag: import-tinc-1.1~595^2~20 X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=d4f9863635d06665cfbd3c46dc482344de240e97;p=meshlink 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; }