From d4f9863635d06665cfbd3c46dc482344de240e97 Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Mon, 18 May 2009 16:53:08 +0400 Subject: [PATCH] bugfix: chdir(/) after chroot Fix the famous chdir(".") vs chdir("/") after chroot(something). --- src/tincd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.39.5