From: Moayad Almalat <m.almalat@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH v2 manager] fix #3037: include the split_list to shell_qoute
Date: Mon, 23 Jan 2023 10:52:35 +0100 [thread overview]
Message-ID: <20230123095235.156177-1-m.almalat@proxmox.com> (raw)
Based to the suggestion of Wolfgang, in regard to `split_list()`,
I converted the `split_list()` to `split(/\0/, $param->{$key});`
this will split the `$param->{$key}` null characters and push each
element to the `$args` array along with the key value.
changes since v1:
* get rid of the `use PVE::Tools qw(split_list);` since not need it anymore.
* replace the split_list to split(/\0/).
Signed-off-by: Moayad Almalat <m.almalat@proxmox.com>
---
PVE/CLI/pvesh.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/PVE/CLI/pvesh.pm b/PVE/CLI/pvesh.pm
index 370fdb0e..9acf292a 100755
--- a/PVE/CLI/pvesh.pm
+++ b/PVE/CLI/pvesh.pm
@@ -106,7 +106,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(/\0/, $param->{$key});
}
my $remcmd = ['ssh', '-o', 'BatchMode=yes', "root\@$remip",
--
2.30.2
next reply other threads:[~2023-01-23 9:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-23 9:52 Moayad Almalat [this message]
2023-01-25 8:38 ` [pve-devel] applied: " Wolfgang Bumiller
2023-01-25 8:59 ` Thomas Lamprecht
2023-01-25 9:30 ` 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=20230123095235.156177-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