From: William Lallemand Date: Wed, 20 Jul 2022 12:30:56 +0000 (+0200) Subject: BUG/MINOR: mworker/cli: relative pid prefix not validated anymore X-Git-Tag: v2.7-dev3~76 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bac3a82a507b029b5e0daf81ed57d07ab8e60677;p=thirdparty%2Fhaproxy.git BUG/MINOR: mworker/cli: relative pid prefix not validated anymore Since e8422bf ("MEDIUM: global: remove the relative_pid from global and mworker"), the relative pid prefix is not tested anymore on the master CLI. Which means any value will fall into the "1" process. Since we removed the nbproc, only the "1" and the "0" (master) value are correct, any other value should return an error. Fix issue #1793. This must be backported as far as 2.5. --- diff --git a/src/cli.c b/src/cli.c index 07d104dd0d..4724ba4f6b 100644 --- a/src/cli.c +++ b/src/cli.c @@ -2294,6 +2294,9 @@ static int pcli_prefix_to_pid(const char *prefix) if (proc_pid == 0) /* return the master */ return 0; + if (proc_pid != 1) /* only the "@1" relative PID is supported */ + return -1; + /* chose the right process, the current one is the one with the least number of reloads */ list_for_each_entry(child, &proc_list, list) {