public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v2 pve-zsync] parse cron: properly split commandline
@ 2022-02-22  9:12 Fabian Ebner
  2022-02-22 12:22 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Ebner @ 2022-02-22  9:12 UTC (permalink / raw)
  To: pve-devel

Reported in the community forum:
https://forum.proxmox.com/threads/105254/

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
---

Changes from v1:
    * Use shellwords().

 pve-zsync | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pve-zsync b/pve-zsync
index 7246336..46b0ba7 100755
--- a/pve-zsync
+++ b/pve-zsync
@@ -9,6 +9,7 @@ use File::Path qw(make_path);
 use JSON;
 use IO::File;
 use String::ShellQuote 'shell_quote';
+use Text::ParseWords;
 
 my $PROGNAME = "pve-zsync";
 my $CONFIG_PATH = "/var/lib/${PROGNAME}";
@@ -308,8 +309,7 @@ sub parse_cron {
     my $cfg = {};
 
     while (my $line = shift(@text)) {
-
-	my @arg = split('\s', $line);
+	my @arg = Text::ParseWords::shellwords($line);
 	my $param = parse_argv(@arg);
 
 	if ($param->{source} && $param->{dest}) {
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-22 12:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-22  9:12 [pve-devel] [PATCH v2 pve-zsync] parse cron: properly split commandline Fabian Ebner
2022-02-22 12:22 ` [pve-devel] applied: " Thomas Lamprecht

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