]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mworker/cli: relative pid prefix not validated anymore
authorWilliam Lallemand <wlallemand@haproxy.org>
Wed, 20 Jul 2022 12:30:56 +0000 (14:30 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 20 Jul 2022 12:43:47 +0000 (14:43 +0200)
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.

src/cli.c

index 07d104dd0dc03bf9180344eea485a9899fb315bf..4724ba4f6b3f117abed4e90cc4702e731d5044eb 100644 (file)
--- 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) {