From 4925fe8ec18e6e064c1eb2c946a82579d2ac567e Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 20 Oct 2011 06:39:45 +0200 Subject: [PATCH] fix shell quoting --- PVE/QemuServer.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 09b617c1..8585d7e2 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -3002,14 +3002,14 @@ sub restore_archive { my $tocmd = "/usr/lib/qemu-server/qmextract"; - $tocmd .= " --storage $opts->{storage}" if $opts->{storage}; + $tocmd .= " --storage " . shellquote($opts->{storage}) if $opts->{storage}; $tocmd .= ' --prealloc' if $opts->{prealloc}; $tocmd .= ' --info' if $opts->{info}; # tar option "xf" does not autodetect compression when read fron STDIN, # so we pipe to zcat - my $cmd = "zcat -f|tar xf " . shellquote($archive) . " --to-command" . - shellquote($tocmd); + my $cmd = "zcat -f|tar xf " . shellquote($archive) . " " . + shellquote("--to-command=$tocmd"); my $tmpdir = "/var/tmp/vzdumptmp$$"; mkpath $tmpdir;