From: Wolfgang Bumiller Date: Mon, 13 Nov 2017 09:31:58 +0000 (+0100) Subject: partially revert: daemon: refactor and cleanup X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=5dff28f06295c4706362ed5c67dd138aac26fc32;hp=563661dd943e969e6df2b97e84043829032794fd;ds=sidebyside 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 --- 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; + } + } } }