]> git.proxmox.com Git - pve-zsync.git/commitdiff
parse cron: properly split commandline
authorFabian Ebner <f.ebner@proxmox.com>
Tue, 22 Feb 2022 09:12:29 +0000 (10:12 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 22 Feb 2022 12:21:43 +0000 (13:21 +0100)
Reported in the community forum:
https://forum.proxmox.com/threads/105254/

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

index 7246336cfff162fc8eb119cfc0c6e5b3b1864d7a..46b0ba72a4e073a2b046a1b16d86ea422e9b3d71 100755 (executable)
--- 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}) {