[pve-devel] [PATCH manager] fix #3037: include the split_list to shell_qoute

Moayad Almalat m.almalat at proxmox.com
Fri Jan 20 13:38:23 CET 2023


By including and using 'split_list' from PVE::Tools we can avoid the null
(\000) bytes in the shell_quote() function, in which the 'split_list' takes
a single argument, to return the array format.
Thanks wolfgang.

Signed-off-by: Moayad Almalat <m.almalat at proxmox.com>
---
 PVE/CLI/pvesh.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/PVE/CLI/pvesh.pm b/PVE/CLI/pvesh.pm
index 370fdb0e..c28a1588 100755
--- a/PVE/CLI/pvesh.pm
+++ b/PVE/CLI/pvesh.pm
@@ -15,6 +15,7 @@ use PVE::CLIHandler;
 use PVE::API2Tools;
 use PVE::API2;
 use JSON;
+use PVE::Tools qw(split_list);
 
 use base qw(PVE::CLIHandler);
 
@@ -106,7 +107,7 @@ sub proxy_handler {
     my $args = [];
     foreach my $key (keys %$param) {
 	next if $key eq 'quiet' || $key eq 'output-format'; # just to  be sure
-	push @$args, "--$key", $param->{$key};
+	push @$args, "--$key", $_ for split_list($param->{$key});
     }
 
     my $remcmd = ['ssh', '-o', 'BatchMode=yes', "root\@$remip",
-- 
2.30.2





More information about the pve-devel mailing list