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)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 18 Mar 2025 15:26:56 +0000 (16:26 +0100)
commitc8d02def1178e9df778439845e6599fb1fb30bd5
treec4066bca08e308497408cbd449553d05832c4f65
parent6a685848b5049683672347266b163c3e6b8a4aa4
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>
(cherry picked from commit 4d7fe11b70df072007eaa1633061e3581b9618fc)
Signed-off-by: Amaury Denoyelle <adenoyelle@haproxy.com>
include/haproxy/cfgparse.h
src/cfgparse.c
src/haproxy.c