]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: cfgparse-global: add more checks for "chroot" argument
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Wed, 20 Nov 2024 15:37:02 +0000 (16:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 21 Nov 2024 18:55:21 +0000 (19:55 +0100)
commitd1c3cd89743861e655ee52c031c8f92486fe96a8
tree6a176cf7448439677408cc3f0e564cc01a392745
parentc853502cc6773856b4ea35ea4a6e505fbed6df59
MINOR: cfgparse-global: add more checks for "chroot" argument

If directory provided as a "chroot" keyword argument does not exist or
inaccessible, this is reported only at the latest initialization stage, when
haproxy tries to perform chroot. Sometimes it's not very convenient, as the
process is already bound to listen sockets.

This was done explicitly in order not to break the case, when haproxy is
launched with "-c" option in some specific environment, where it's not possible
to create or to modify chroot directory, provided in the configuration.

So, let's add more checks for "chroot" directory during the parsing
stage and let's show diagnostic warnings, if this directory has become
non-accesible or was deleted. Like this, users, who wants to catch errors
related to misconfigured chroot before starting the process, can launch haproxy
with -dW and -dD. zero-warning mode will stop the process with error, if any
warning was emitted during initialization stage.
src/cfgparse-global.c