HomeFreeBSD

sbin/md5: improve compatibility with coreutils -c option

Description

sbin/md5: improve compatibility with coreutils -c option

The -c option expects a digest file in either BSD or coreutils format.

The output for matched and mismatched files is identical to that
of the coreutils version.

The review of these changes included test cases that have already
been committed for the functionality that existed before.
Another test script is added to cover the coreutils compatible
extension implemented by this patch.

This commit contains a tests/Makefile that has been cleaned up
compared to the review version, using an implicit rule to apply the
TESTBASE path at build time (and the scripts have been renamed to
have an extension of .SH instead of .sh to trigger this rule).

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D30812

(cherry picked from commit 84f35b6f86efd004a8f25ef6eecea0f5d02733c4)
(cherry picked from commit c2870e576bd20872ed227375a862e0330ef90ad8)

Details

Provenance
seAuthored on Jun 19 2021, 11:27 AM
Reviewer
imp
Differential Revision
D30812: Add support for -c option to sha256sum et.al.
Parents
rG9ecf4bd8e904: md5: portability fix -- include stdbool.h explicitly
Branches
Unknown
Tags
Unknown