MINOR: startup: do not execute chroot() when "/"

We'll recommend to use "chroot /" to explicitly disable chroot, however
there might be configurations where it would cause problems to just issue
the syscall (typically some hardened containers), so let's make sure that
"chroot /" is a nop in this case.
This commit is contained in:
Willy Tarreau 2026-05-20 11:05:17 +02:00
parent d142c7f421
commit 3c35e7f137

View file

@ -3351,7 +3351,7 @@ static int do_chroot(const char *prog, const char *path)
DISGUISE(rmdir(tmpdir));
if (!error)
error = chroot(".");
} else {
} else if (strcmp(path, "/") != 0) {
error = chroot(path);
}
if (!error)