BUG/MINOR: cli: fix CLI handler "set anon global-key" call
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 3 Mar 2023 16:11:10 +0000 (17:11 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 3 Mar 2023 17:05:58 +0000 (18:05 +0100)
commitdd3a33f863c4a40af68eb9399860d25d7c56a658
treee2982ddb0e47f4bb67bff937ebb62e8079914109
parentc8a0efbda86a14af38084ce85933bb691563935c
BUG/MINOR: cli: fix CLI handler "set anon global-key" call

Anonymization mode has two CLI handlers "set anon <on|off>" and "set
anon global-key". The last one only requires admin level. However, as
cli_find_kw() is implemented, only the first handler will be retrieved
as they both start with the same prefix "set anon".

This has the effect to execute the wrong handler for "set anon
global-key" with an error message about an invalid keyword. To fix this,
handlers definition have been separated for both "set anon on" and "set
anon off" commands. This allows to have minimal changes while keeping
the same "set anon" prefix for each commands.

Also take this opportunity to fix a reference to a non-existing "set
global-key" CLI handler in the documentation.

This must be backported up to 2.7.
doc/configuration.txt
src/cli.c