bugfix: chdir(/) after chroot
[oweals/tinc.git] / src / tincd.c
index 929e9b91f89041bac996ea1eacd43ab4f1fc0c57..89bda91b0119424ce1d7496a72ffb0fc92e8588f 100644 (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;
                }