[pve-devel] [PATCH container] vzdump: fix compression command pipe

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Dec 9 16:30:34 CET 2015


$comp is a command string and needs to be split. The set of
possible commands is limited and known so splitting by
/\s+/ (as suggested by Marc Cousin) should be safe enough.

Fixes #840
---
 src/PVE/VZDump/LXC.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/PVE/VZDump/LXC.pm b/src/PVE/VZDump/LXC.pm
index 6d50ca2..5d25a7d 100644
--- a/src/PVE/VZDump/LXC.pm
+++ b/src/PVE/VZDump/LXC.pm
@@ -326,7 +326,7 @@ sub archive {
 
     my $bwl = $opts->{bwlimit}*1024; # bandwidth limit for cstream
     push @$cmd, [ 'cstream', '-t', $bwl ] if $opts->{bwlimit};
-    push @$cmd, [ $comp ] if $comp;
+    push @$cmd, [ split(/\s+/, $comp) ] if $comp;
 
     if ($opts->{stdout}) {
 	push @{$cmd->[-1]}, \(">&" . fileno($opts->{stdout}));
-- 
2.1.4





More information about the pve-devel mailing list