]> git.kaiwu.me - haproxy.git/commit
MINOR: cfgparse: Refactor "userlist" parser to print it in -dKall operation
authorHyeonggeun Oh <hyeonggeun.oh@plaintexting.com>
Tue, 6 Jan 2026 04:22:12 +0000 (13:22 +0900)
committerWilliam Lallemand <wlallemand@haproxy.com>
Wed, 7 Jan 2026 17:25:09 +0000 (18:25 +0100)
commitc17ed69bf34ebd40a679fc514a4f3d94ae40dbeb
tree58a078f654fdbd463b0d5876e2882bbdd661c0ee
parent91cff75908171d0d57aa7976b611e4e2de868b47
MINOR: cfgparse: Refactor "userlist" parser to print it in -dKall operation

This patch covers issue https://github.com/haproxy/haproxy/issues/3221.

The parser for the "userlist" section did not use the standard keyword
registration mechanism. Instead, it relied on a series of strcmp()
comparisons to identify keywords such as "group" and "user".

This had two main drawbacks:
1. The keywords were not discoverable by the "-dKall" dump option,
   making it difficult for users to see all available keywords for the
   section.
2. The implementation was inconsistent with the parsers for other
   sections, which have been progressively refactored to use the
   standard cfg_kw_list infrastructure.

This patch refactors the userlist parser to align it with the project's
standard conventions.

The parsing logic for the "group" and "user" keywords has been extracted
from the if/else block in cfg_parse_users() into two new dedicated
functions:
- cfg_parse_users_group()
- cfg_parse_users_user()

These two keywords are now registered via a dedicated cfg_kw_list,
making them visible to the rest of the HAPorxy ecosystem, including the
-dKall dump.
src/cfgparse.c