diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-03-24 00:46:22 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-03-24 00:46:22 +0000 |
commit | dd52d0e37fe2f9a207f98abaf21108a6af8d5d3b (patch) | |
tree | 60c5f9b004d44fbb0ab38d412006cc6d7f52a735 /sys-apps/coreutils/files | |
parent | 3bd958e646e508a3e80f5fb28f44384eed671f5d (diff) |
gentoo auto-resync : 24:03:2023 - 00:46:21
Diffstat (limited to 'sys-apps/coreutils/files')
-rw-r--r-- | sys-apps/coreutils/files/coreutils-9.2-cksum-result-reporting.patch | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/sys-apps/coreutils/files/coreutils-9.2-cksum-result-reporting.patch b/sys-apps/coreutils/files/coreutils-9.2-cksum-result-reporting.patch new file mode 100644 index 000000000000..4381d750317b --- /dev/null +++ b/sys-apps/coreutils/files/coreutils-9.2-cksum-result-reporting.patch @@ -0,0 +1,59 @@ +https://www.reddit.com/r/archlinux/comments/11zdecf/sha256sum_c_prints_ok_for_a_failed_checksum_when/ +https://bugs.archlinux.org/task/77969 +https://bugs.gnu.org/62403 + +https://github.com/coreutils/coreutils/commit/76f2fb627118a26c25003dbd98c22c153b7ee1d2 + +From 76f2fb627118a26c25003dbd98c22c153b7ee1d2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com> +Date: Thu, 23 Mar 2023 12:31:24 +0000 +Subject: [PATCH] cksum: fix reporting of failed checks + +This applies to all checksumming utilities, +where we incorrectly report all subsequent files as checking 'OK' +once any file has passed a digest check. +The exit status was not impacted, only the printed status. + +* src/digest.c (digest_check): Use the correct state variable +to determine if the _current_ file has passed or not. +* tests/misc/md5sum.pl: Add a test case. +Fixes https://bugs.gnu.org/62403 +--- a/src/digest.c ++++ b/src/digest.c +@@ -1254,14 +1254,14 @@ digest_check (char const *checkfile_name) + + if (!status_only) + { +- if ( ! matched_checksums || ! quiet) ++ if (! match || ! quiet) + { + if (needs_escape) + putchar ('\\'); + print_filename (filename, needs_escape); + } + +- if ( ! matched_checksums) ++ if (! match) + printf (": %s\n", _("FAILED")); + else if (!quiet) + printf (": %s\n", _("OK")); +--- a/tests/misc/md5sum.pl ++++ b/tests/misc/md5sum.pl +@@ -101,6 +101,16 @@ + . "md5sum: WARNING: 1 line is improperly formatted\n" + . "md5sum: WARNING: 2 computed checksums did NOT match\n"}, + {EXIT=> 1}], ++ # Ensure we use appropriate state to track failures (broken in 9.2) ++ ['check-multifail-state', '--check', '--warn', ++ {IN=>{'f.md5' => ++ "$degenerate f\n" ++ . "$degenerate g\n" ++ . "$degenerate f\n" }}, ++ {AUX=> {f=> ''}}, {AUX=> {g=> 'a'}}, ++ {OUT=>"f: OK\ng: FAILED\nf: OK\n"}, ++ {ERR=>"md5sum: WARNING: 1 computed checksum did NOT match\n"}, ++ {EXIT=> 1}], + # The sha1sum and md5sum drivers share a lot of code. + # Ensure that md5sum does *not* share the part that makes + # sha1sum accept BSD format. + |