From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id E7A6395DAC for ; Fri, 20 Jan 2023 14:23:15 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C07E67D34 for ; Fri, 20 Jan 2023 14:23:15 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 20 Jan 2023 14:23:15 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id F0DC845578 for ; Fri, 20 Jan 2023 14:23:14 +0100 (CET) Date: Fri, 20 Jan 2023 14:23:14 +0100 From: Wolfgang Bumiller To: Moayad Almalat Cc: pve-devel@lists.proxmox.com Message-ID: <20230120132314.oualy2tscwxoh6im@fwblub> References: <20230120123823.261828-1-m.almalat@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230120123823.261828-1-m.almalat@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.205 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [pvesh.pm] Subject: Re: [pve-devel] [PATCH manager] fix #3037: include the split_list to shell_qoute X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2023 13:23:16 -0000 On Fri, Jan 20, 2023 at 01:38:23PM +0100, Moayad Almalat wrote: > 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 > --- > 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}); Looking at it again I think it might actually make more sense to just use `split(/\0/, ...)` instead of `split_list()`, since I don't think we want spaces, commas or semicolons cause splits here. Given we're in a CLI tool here, I think this will always come as `\0` separated data initially. > } > > my $remcmd = ['ssh', '-o', 'BatchMode=yes', "root\@$remip", > -- > 2.30.2