BUG/MINOR: cli: Issue an error when too many args are passed for a command
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 23 Apr 2025 13:29:00 +0000 (15:29 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 15 May 2025 15:01:43 +0000 (17:01 +0200)
commitcb0fbd5e1a7cdde5210fea8ef87ede21c431807d
tree7e224596b60866907212fc109c21a05cfee745b8
parent1c913c47cad4b00c9fef726b32b1a4240161a89e
BUG/MINOR: cli: Issue an error when too many args are passed for a command

When a command is parsed to split it in an array of arguments, by default,
at most 64 arguments are supported. But no warning was emitted when there
were too many arguments. Instead, the arguments above the limit were
silently ignored. It could be an issue for some commands, like "add server",
because there was no way to know some arguments were ignored.

Now an error is issued when too many arguments are passed and the command is
not executed.

This patch should be backported to all stable versions.

(cherry picked from commit d3f92894471dd7306f857156a5820c53c10f8d88)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/cli.c