From 5dff28f06295c4706362ed5c67dd138aac26fc32 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Mon, 13 Nov 2017 10:31:58 +0100 Subject: [PATCH 1/1] partially revert: daemon: refactor and cleanup Reverts a hunk of 0da5a3e43b16 which removed checking & untainting of pids from the PVE_DAEMON_WORKER_PIDS env var. Signed-off-by: Wolfgang Bumiller --- src/PVE/Daemon.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/PVE/Daemon.pm b/src/PVE/Daemon.pm index ee3c67c..9e03c80 100644 --- a/src/PVE/Daemon.pm +++ b/src/PVE/Daemon.pm @@ -280,7 +280,12 @@ sub setup { if ($restart && $self->{max_workers}) { if (my $wpids = $ENV{PVE_DAEMON_WORKER_PIDS}) { - $self->{old_workers}->{$_} = 1 foreach (split(':', $wpids)); + foreach my $pid (split(':', $wpids)) { + # check & untaint + if ($pid =~ m/^(\d+)$/) { + $self->{old_workers}->{$1} = 1; + } + } } } -- 2.39.2