public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH common] fix #3747: download_file_from_url: trim whitespace before comparing checksum
@ 2021-12-02 13:38 Oguz Bektas
  2021-12-03  8:03 ` Fabian Ebner
  0 siblings, 1 reply; 4+ messages in thread
From: Oguz Bektas @ 2021-12-02 13:38 UTC (permalink / raw)
  To: pve-devel

so that we don't get checksum mismatch in case the user accidentally
copies whitespace in the checksum field.

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;
 	}
     }
-- 
2.30.2





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

end of thread, other threads:[~2021-12-03 10:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-02 13:38 [pve-devel] [PATCH common] fix #3747: download_file_from_url: trim whitespace before comparing checksum Oguz Bektas
2021-12-03  8:03 ` Fabian Ebner
2021-12-03  9:20   ` Fabian Grünbichler
2021-12-03 10:11   ` 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