]> git.proxmox.com Git - pve-common.git/commitdiff
partially revert: daemon: refactor and cleanup
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 13 Nov 2017 09:31:58 +0000 (10:31 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 13 Nov 2017 09:32:01 +0000 (10:32 +0100)
Reverts a hunk of 0da5a3e43b16 which removed checking &
untainting of pids from the PVE_DAEMON_WORKER_PIDS env var.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/PVE/Daemon.pm

index ee3c67c4d4895fb6bcbae008946f7228263a619f..9e03c801db014f617c58c6f0216bbedd233c44f0 100644 (file)
@@ -280,7 +280,12 @@ sub setup {
 
     if ($restart && $self->{max_workers}) {
        if (my $wpids = $ENV{PVE_DAEMON_WORKER_PIDS}) {
 
     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;
+               }
+           }
        }
     }
 
        }
     }