]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: cli: forward the whole command on master CLI
authorWilliam Lallemand <wlallemand@haproxy.com>
Mon, 29 Oct 2018 16:14:00 +0000 (17:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 29 Oct 2018 16:23:27 +0000 (17:23 +0100)
A bug occurs when the CLI proxy of the master received a command which
is prefixed by some spaces but without a routing prefix (@).
In this case the pcli_parse_request() was returning a wrong number of
data to forward.

The response analyzer was called twice and the prompt displayed twice.

src/cli.c

index e1b527465fbe83d639cfbf9a84305eb776e45ccf..510e1e3496587602d961dd434484a80482741c3b 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -1766,7 +1766,7 @@ int pcli_parse_request(struct channel *req, int *target_pid)
                                if (*pfx_b != '@') {
                                        /* there is no prefix */
                                        pfx_b = NULL;
-                                       cmd_b = ptr;
+                                       cmd_b = input; /* if no prefix we don't trim anything */
                                        state = PCLI_REQ_CMD;
                                        continue;
                                }