[pve-devel] [PATCH 5/7] fix ' escaping of $snap parameter

Stefan Priebe s.priebe at profihost.ag
Fri Feb 7 12:16:36 CET 2014


Signed-off-by: Stefan Priebe <s.priebe at profihost.ag>
---
 PVE/Storage/RBDPlugin.pm |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
index 99620a7..4d2c75d 100644
--- a/PVE/Storage/RBDPlugin.pm
+++ b/PVE/Storage/RBDPlugin.pm
@@ -335,7 +335,7 @@ sub create_base {
 
     if (!$protected){
 	my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'protect', $newname, '--snap', $snap);
-	run_rbd_command($cmd, errmsg => "rbd protect $newname snap $snap' error");
+	run_rbd_command($cmd, errmsg => "rbd protect $newname snap '$snap' error");
     }
 
     return $newvolname;
@@ -401,7 +401,7 @@ sub free_image {
 	my (undef, undef, undef, $protected) = rbd_volume_info($scfg, $storeid, $name, $snap);
 	if ($protected){
 	    my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'unprotect', $name, '--snap', $snap);
-	    run_rbd_command($cmd, errmsg => "rbd unprotect $name snap $snap' error");
+	    run_rbd_command($cmd, errmsg => "rbd unprotect $name snap '$snap' error");
 	}
     }
 
@@ -532,7 +532,7 @@ sub volume_snapshot_rollback {
     my ($vtype, $name, $vmid) = $class->parse_volname($volname);
 
     my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'rollback', '--snap', $snap, $name);
-    run_rbd_command($cmd, errmsg => "rbd snapshot $volname to $snap' error");
+    run_rbd_command($cmd, errmsg => "rbd snapshot $volname to '$snap' error");
 }
 
 sub volume_snapshot_delete {
@@ -545,7 +545,7 @@ sub volume_snapshot_delete {
     my (undef, undef, undef, $protected) = rbd_volume_info($scfg, $storeid, $name, $snap);
     if ($protected){
 	my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'unprotect', $name, '--snap', $snap);
-	run_rbd_command($cmd, errmsg => "rbd unprotect $name snap $snap' error");
+	run_rbd_command($cmd, errmsg => "rbd unprotect $name snap '$snap' error");
     }
 
     my $cmd = &$rbd_cmd($scfg, $storeid, 'snap', 'rm', '--snap', $snap, $name);
-- 
1.7.10.4




More information about the pve-devel mailing list