BUG/MEIDUM: startup: return to initial cwd only after check_config_validity()
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Tue, 4 Mar 2025 10:04:01 +0000 (11:04 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 13 Mar 2025 15:01:04 +0000 (16:01 +0100)
commit4d7fe11b70df072007eaa1633061e3581b9618fc
tree8534d38598b93ea7001c470a4f159ae7ebaadd86
parent7e5d59e8bf5f44c57e2cd13427aef5288777fbd2
BUG/MEIDUM: startup: return to initial cwd only after check_config_validity()

In check_config_validity() we evaluate some sample fetch expressions
(log-format, server rules, etc). These expressions may use external files like
maps.

If some particular 'default-path' was set in the global section before, it's no
longer applied to resolve file pathes in check_config_validity(). parse_cfg()
at the end of config parsing switches back to the initial cwd.

This fixes the issue #2886.

This patch should be backported in all stable versions since 2.4.0, including
2.4.0.

(cherry picked from commit e900ef987e4167cf0921e97b09059d757f2c0ea5)
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/haproxy/cfgparse.h
src/cfgparse.c
src/haproxy.c