aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2024-03-04 16:33:23 +0000
committerPádraig Brady <P@draigBrady.com>2024-03-04 16:35:27 +0000
commitfea833591ba787b1232d13ac4b985bea1e7601de (patch)
treeb91e4f6780ec2d05c444415494299831912f39c6 /tests
parentdoc: fix spellings in NEWS (diff)
downloadcoreutils-fea833591ba787b1232d13ac4b985bea1e7601de.tar.gz
coreutils-fea833591ba787b1232d13ac4b985bea1e7601de.zip
cksum: consistently validate --length attributes
* src/digest.c (main): Only validate the last used --length for being a multiple of 8. * tests/cksum/b2sum.sh: Add a test case. Fixes https://bugs.gnu.org/69546
Diffstat (limited to 'tests')
-rwxr-xr-xtests/cksum/b2sum.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/cksum/b2sum.sh b/tests/cksum/b2sum.sh
index cc480a478..43a62d2fb 100755
--- a/tests/cksum/b2sum.sh
+++ b/tests/cksum/b2sum.sh
@@ -65,6 +65,10 @@ returns_ 1 $prog -c crash.check || fail=1
printf '0A0BA0' > overflow.check || framework_failure_
returns_ 1 $prog -c overflow.check || fail=1
+# This would fail before coreutil-9.4
+# Only validate the last specified, used length
+$prog -l 123 -l 128 /dev/null || fail=1
+
done
Exit $fail