From 0609c9bde98a80b25bf28f268665de65770a38da Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 12 Mar 2021 17:03:33 +0100 Subject: [PATCH] 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. --- src/cli.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli.c b/src/cli.c index 04c4e7a19..99cb9df86 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 },