mirror of
https://github.com/haproxy/haproxy.git
synced 2026-05-21 09:25:29 -04:00
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:
parent
d142c7f421
commit
3c35e7f137
1 changed files with 1 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue