From ea5eb43003c887f0fc5b35fbd10c14b54b082e08 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 24 Jun 2013 08:02:32 +0200 Subject: [PATCH] fix shell quoting for upgrade command --- PVE/API2/Nodes.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm index 2925ed37..4cfcfd25 100644 --- a/PVE/API2/Nodes.pm +++ b/PVE/API2/Nodes.pm @@ -631,7 +631,9 @@ __PACKAGE__->register_method ({ if ($user eq 'root@pam') { if ($param->{upgrade}) { - $shcmd = [ '/bin/bash', '-c', '"pveupgrade --shell"' ]; + my $upgradecmd = "pveupgrade --shell"; + $upgradecmd = PVE::Tools::shellquote($upgradecmd) if $remip; + $shcmd = [ '/bin/bash', '-c', $upgradecmd ]; } else { $shcmd = [ '/bin/bash', '-l' ]; }