From bac3a82a507b029b5e0daf81ed57d07ab8e60677 Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Wed, 20 Jul 2022 14:30:56 +0200 Subject: [PATCH] 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. --- src/cli.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cli.c b/src/cli.c index 07d104dd0..4724ba4f6 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) {