]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
md5: fix *sum -c with missing files
authorKyle Evans <kevans@FreeBSD.org>
Mon, 13 Feb 2023 06:32:38 +0000 (00:32 -0600)
committerKyle Evans <kevans@FreeBSD.org>
Mon, 13 Feb 2023 06:32:38 +0000 (00:32 -0600)
commit8d78a0d331ec2c168efe6cb85bbc2da86e9a6124
treedeba90dde620c7d3d0c2f3f47916596dfa8ee5ff
parent7e688ed493482c5346d969e7667856d8ced8d87a
md5: fix *sum -c with missing files

If we fail to open one of the files in the file listing, we still need
to advance `rec` along with `argv` so that the checksum we're checking
against lines up with the file we're hashing.

Tests added both for the -c flag, as well as the -b and -t modes of
the *sum programs.

PR: 267722
Reviewed by: emaste (earlier version)
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D37374
sbin/md5/md5.c
sbin/md5/tests/Makefile
sbin/md5/tests/md5_test.sh [new file with mode: 0644]
sbin/md5/tests/sum_a.in [new file with mode: 0644]
sbin/md5/tests/sum_b.in [new file with mode: 0644]
sbin/md5/tests/sum_c.in [new file with mode: 0644]
sbin/md5/tests/sum_sums.digest [new file with mode: 0644]