all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Fabian Ebner <f.ebner@proxmox.com>
Subject: Re: [pve-devel] [PATCH pve-zsync 2/2] parse cron: handle additional whitespace
Date: Mon, 21 Feb 2022 16:05:59 +0100	[thread overview]
Message-ID: <0fd187d3-671f-de02-3a17-de1048642286@proxmox.com> (raw)
In-Reply-To: <20220221090750.17598-2-f.ebner@proxmox.com>

On 21.02.22 10:07, Fabian Ebner wrote:
> Can only happen by manually editing AFAICT, but cron does execute the
> jobs, so just be a bit less restrictive when parsing.

I mean, it won't get more broken as already but can we avoid white-space splitting
on command arguments in general?

We could use the same underlying helper as PVE::Tools::split_args uses,
Text::ParseWords::shellwords (included in perl-modules directly)..

> 
> Reported in the community forum:
> https://forum.proxmox.com/threads/105254/
> 
> Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
> ---
>  pve-zsync | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/pve-zsync b/pve-zsync
> index 7246336..f69e126 100755
> --- a/pve-zsync
> +++ b/pve-zsync
> @@ -308,8 +308,7 @@ sub parse_cron {
>      my $cfg = {};
>  
>      while (my $line = shift(@text)) {
> -
> -	my @arg = split('\s', $line);
> +	my @arg = split('\s+', $line);
>  	my $param = parse_argv(@arg);
>  
>  	if ($param->{source} && $param->{dest}) {





  reply	other threads:[~2022-02-21 15:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-21  9:07 [pve-devel] [PATCH pve-zsync 1/2] rename encode_cron to parse_cron Fabian Ebner
2022-02-21  9:07 ` [pve-devel] [PATCH pve-zsync 2/2] parse cron: handle additional whitespace Fabian Ebner
2022-02-21 15:05   ` Thomas Lamprecht [this message]
2022-02-21 15:06 ` [pve-devel] applied: [PATCH pve-zsync 1/2] rename encode_cron to parse_cron Thomas Lamprecht

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=0fd187d3-671f-de02-3a17-de1048642286@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=f.ebner@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal