From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Oguz Bektas <o.bektas@proxmox.com>,
Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH common] fix #3747: download_file_from_url: trim whitespace before comparing checksum
Date: Fri, 03 Dec 2021 10:20:14 +0100 [thread overview]
Message-ID: <1638523162.slpbukq1bk.astroid@nora.none> (raw)
In-Reply-To: <6670482a-986b-d81d-bde1-96d0c8de48ee@proxmox.com>
On December 3, 2021 9:03 am, Fabian Ebner wrote:
> 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;
PVE::Tools::trim ?
>> last;
>> }
>> }
>>
>
>
> _______________________________________________
> pve-devel mailing list
> pve-devel@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
>
>
>
next prev parent reply other threads:[~2021-12-03 9:20 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
2021-12-03 9:20 ` Fabian Grünbichler [this message]
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=1638523162.slpbukq1bk.astroid@nora.none \
--to=f.gruenbichler@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 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.