]> git.proxmox.com Git - pve-common.git/blobdiff - src/PVE/Daemon.pm
partially revert: daemon: refactor and cleanup
[pve-common.git] / 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}) {
-           $self->{old_workers}->{$_} = 1 foreach (split(':', $wpids));
+           foreach my $pid (split(':', $wpids)) {
+               # check & untaint
+               if ($pid =~ m/^(\d+)$/) {
+                   $self->{old_workers}->{$1} = 1;
+               }
+           }
        }
     }