[pve-devel] [PATCH] pvecm use of uninitialized value $ARGV[0]

Alen Grizonic a.grizonic at proxmox.com
Thu Jun 18 15:58:29 CEST 2015


Just a small bug fix for the pvecm script which did not verify the argument existence during the $ARGV[0] check (when argument not used).

Script run error -> Use of uninitialized value $ARGV[0] in string ne at /usr/bin/pvecm line 26.

Signed-off-by: Alen Grizonic <a.grizonic at proxmox.com>
---
 data/PVE/pvecm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/data/PVE/pvecm b/data/PVE/pvecm
index 5017e9d..3e6e25f 100755
--- a/data/PVE/pvecm
+++ b/data/PVE/pvecm
@@ -23,7 +23,7 @@ $ENV{HOME} = '/root'; # for ssh-copy-id
 
 my ($local_ip_address, $nodename);
 
-if ($ARGV[0] ne 'printmanpod' && $ARGV[0] ne 'verifyapi') {
+if (defined $ARGV[0] && $ARGV[0] ne 'printmanpod' && $ARGV[0] ne 'verifyapi') {
     die "please run as root\n" if $> != 0;
 
     $nodename = PVE::INotify::nodename();
-- 
2.1.4





More information about the pve-devel mailing list