]> git.proxmox.com Git - pve-common.git/commitdiff
Daemon: untaint value read from ENV
authorDietmar Maurer <dietmar@proxmox.com>
Wed, 31 Dec 2014 16:28:33 +0000 (17:28 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 31 Dec 2014 16:28:33 +0000 (17:28 +0100)
data/PVE/Daemon.pm

index 3d214015ecbd0b329bd40d554abbd7709b706d80..b6714531c7253b8e95a03b57e91547b02b37f46d 100644 (file)
@@ -366,6 +366,11 @@ sub new {
        my $lockfd = $ENV{PVE_DAEMON_LOCK_FD};
        delete $ENV{PVE_DAEMON_LOCK_FD};
 
+       if (defined($lockfd)) {
+           $lockfd =~ m/^(\d+)$/;
+           $lockfd = $1; # untaint
+       }
+
        die "please run as root\n" if !$restart && ($> != 0);
 
        die "can't create more that one PVE::Daemon" if $daemon_initialized;