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)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 20 May 2025 16:06:29 +0000 (18:06 +0200)
commit23a7425ad2091891b0b13906680975ca65cc688e
treedb69675f989e8e2400b690237fbcd8a8df9476d6
parent4d037722257f3542344829f4948658e3196ce740
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>
(cherry picked from commit cb0fbd5e1a7cdde5210fea8ef87ede21c431807d)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/cli.c