[pve-devel] [PATCH common] fix #923: uninitalized value in remove_lock

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Mar 30 14:00:12 CEST 2016


---
 src/PVE/AbstractConfig.pm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/PVE/AbstractConfig.pm b/src/PVE/AbstractConfig.pm
index f1c0eb2..0799c8b 100644
--- a/src/PVE/AbstractConfig.pm
+++ b/src/PVE/AbstractConfig.pm
@@ -136,9 +136,10 @@ sub remove_lock {
     $class->lock_config($vmid, sub {
 	my $conf = $class->load_config($vmid);
 	if (!$conf->{lock}) {
-	    die "no lock found trying to remove lock '$lock'\n";
+	    my $lockstring = defined($lock) ? "'$lock' " : "any";
+	    die "no lock found trying to remove $lockstring lock\n";
 	} elsif (defined($lock) && $conf->{lock} ne $lock) {
-	    die "found lock '$conf->{lock}' trying to remove lock '$lock'\n";
+	    die "found lock '$conf->{lock}' trying to remove '$lock' lock\n";
 	}
 	delete $conf->{lock};
 	$class->write_config($vmid, $conf);
-- 
2.1.4





More information about the pve-devel mailing list