]> git.kaiwu.me - haproxy.git/commit
BUG/MAJOR: cfgparse: properly check userlist section when scanning keywords
authorWilly Tarreau <w@1wt.eu>
Fri, 9 Oct 2026 06:52:44 +0000 (08:52 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Oct 2026 07:22:33 +0000 (09:22 +0200)
commitda16d8531fed8d3a55b43462a6fb5f8c66bc9689
treeae7fbb0a7d93bc29dfcd4140d130bb855509fc75
parentfe8a8c322e593d5752c1f9cacbc3a35492382f6e
BUG/MAJOR: cfgparse: properly check userlist section when scanning keywords

In cfg_parse_users(), we scan all config keywords and only want to
evaluate those whose section is CFG_USERLIST. However, the section
is checked as a bit field instead of an equality, and CFG_USERLIST
is 3, which is CFG_GLOBAL|CFG_LISTEN, meaning that we can call a
wrong parser for keywords "user" or "group" when they are registered
in one of these sections. This is what randomly happens when the
global "group" keyword is refactored to have its own parser, depending
on build options the linker, it may randomly be found before or after
the userlist's and cause startup failures if the global section's
keyword parser is called from the userlist parser, such as in this
regtest that only fails with ASAN on the CI when the config only has
"group" set in a userlist section:

  config : parsing [cfg:18] : cannot find group id for 'admins' (0:Success)

This was introduced in 3.4 with commit c17ed69bf3 ("MINOR: cfgparse:
Refactor "userlist" parser to print it in -dKall operation") so it must
be backported there.

If a config works it's OK, but this was still marked major because
there's simply no workaround for a failing binary where it only
depends on build options. It could happen for example if other
keywords are added via Lua or patches.
src/cfgparse.c