public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com, Oguz Bektas <o.bektas@proxmox.com>
Subject: Re: [pve-devel] [PATCH common] fix #3747: download_file_from_url: trim whitespace before comparing checksum
Date: Fri, 3 Dec 2021 09:03:26 +0100	[thread overview]
Message-ID: <6670482a-986b-d81d-bde1-96d0c8de48ee@proxmox.com> (raw)
In-Reply-To: <20211202133842.1000372-1-o.bektas@proxmox.com>

Am 02.12.21 um 14:38 schrieb Oguz Bektas:
> so that we don't get checksum mismatch in case the user accidentally
> copies whitespace in the checksum field.
> 

Isn't this better done in the UI? Or at least upon parameter validation 
(but we don't do this for any other parameter, or)?.

> Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
> ---
>   src/PVE/Tools.pm | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm
> index 787942a..fa14f2f 100644
> --- a/src/PVE/Tools.pm
> +++ b/src/PVE/Tools.pm
> @@ -1921,6 +1921,7 @@ sub download_file_from_url {
>   	if (defined($opts->{"${_}sum"})) {
>   	    $checksum_algorithm = $_;
>   	    $checksum_expected = $opts->{"${_}sum"};
> +	    $checksum_expected =~ s/^\s+|\s+$//g;
>   	    last;
>   	}
>       }
> 




  reply	other threads:[~2021-12-03  8:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02 13:38 Oguz Bektas
2021-12-03  8:03 ` Fabian Ebner [this message]
2021-12-03  9:20   ` Fabian Grünbichler
2021-12-03 10:11   ` 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=6670482a-986b-d81d-bde1-96d0c8de48ee@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=o.bektas@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal