public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Moayad Almalat <m.almalat@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager] fix #3037: include the split_list to shell_qoute
Date: Fri, 20 Jan 2023 13:38:23 +0100	[thread overview]
Message-ID: <20230120123823.261828-1-m.almalat@proxmox.com> (raw)

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@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




             reply	other threads:[~2023-01-20 12:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20 12:38 Moayad Almalat [this message]
2023-01-20 13:23 ` Wolfgang Bumiller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230120123823.261828-1-m.almalat@proxmox.com \
    --to=m.almalat@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal