From: Willy Tarreau Date: Fri, 12 Mar 2021 16:03:33 +0000 (+0100) Subject: BUG/MINOR: cli: make sure "help", "prompt", "quit" are enabled at master level X-Git-Tag: v2.4-dev12~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0609c9bde98a80b25bf28f268665de65770a38da;p=thirdparty%2Fhaproxy.git BUG/MINOR: cli: make sure "help", "prompt", "quit" are enabled at master level These 3 commands are functionally valid both in master and worker CLIs. However, while they do have a valid handler, they are not permitted by the code and work partially by chance in the master: - "prompt" and "quit" are intercepted by the request analyser - "help" triggers an error, which results in displaying the error message Let's make sure they are permitted so that we don't count errors there and that we can report appropriate help. This bug has always been there but it doesn't have any functional effect at the moment since "help" can only show the error message. As such, there is no need to backport it. --- diff --git a/src/cli.c b/src/cli.c index 04c4e7a196..99cb9df864 100644 --- a/src/cli.c +++ b/src/cli.c @@ -2795,9 +2795,9 @@ static struct applet mcli_applet = { /* register cli keywords */ static struct cli_kw_list cli_kws = {{ },{ - { { "help", NULL }, NULL, cli_parse_simple, NULL }, - { { "prompt", NULL }, NULL, cli_parse_simple, NULL }, - { { "quit", NULL }, NULL, cli_parse_simple, NULL }, + { { "help", NULL }, NULL, cli_parse_simple, NULL, NULL, NULL, ACCESS_MASTER }, + { { "prompt", NULL }, NULL, cli_parse_simple, NULL, NULL, NULL, ACCESS_MASTER }, + { { "quit", NULL }, NULL, cli_parse_simple, NULL, NULL, NULL, ACCESS_MASTER }, { { "set", "maxconn", "global", NULL }, "set maxconn global : change the per-process maxconn setting", cli_parse_set_maxconn_global, NULL }, { { "set", "rate-limit", NULL }, "set rate-limit : change a rate limiting value", cli_parse_set_ratelimit, NULL }, { { "set", "severity-output", NULL }, "set severity-output [none|number|string] : set presence of severity level in feedback information", cli_parse_set_severity_output, NULL, NULL },