]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sbin/md5: add md5sum to synopsis in the man-page
authorStefan Eßer <se@FreeBSD.org>
Sat, 19 Jun 2021 11:27:16 +0000 (13:27 +0200)
committerStefan Eßer <se@FreeBSD.org>
Tue, 6 Jul 2021 15:44:14 +0000 (17:44 +0200)
commitb7c17fd730ca4e8806a506b617ad32218aa0b826
tree9dc6ed434adea2f515e7261c198e2473c15e2bf1
parent04beb393e36691f415fbaf1746d4b981784ab734
sbin/md5: add md5sum to synopsis in the man-page

When invoked with "sum" following the hash name, the -c option takes a
file argument, not a string argument.

(cherry picked from commit 84f35b6f86efd004a8f25ef6eecea0f5d02733c4)

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 b33d1898c1b0e6d76b52eb48078260588802dc95)

md5: Improve compatibility with coreutils and format fix

The previous changes that added support for the coreutils -c option
modified the output generated by passing -r to match that of the
coreutils versions. The difference is that coreutils separates the
hash from the file name by two blanks "  " (or a blank followed by
an asterisk " *" with the -b option denoting).

While most scripts or users will not notice the difference, it might
be considered a violation of POLA and this commit reverts the change
for the non-sum programs. These will print a single blank " " as the
separator, as they die before the previous commit.

In order to still generate output that is identical to that of the
coreutils programs, this commit generates the "  " or " *" separator
used by them for the -sum versions, depending on the presence of the
-b option.

(cherry picked from commit b33d1898c1b0e6d76b52eb48078260588802dc95)

md5: Fix cross-build after c2870e576bd2

On macOS and Linux the current set of headers do not end up pulling in
sys/param.h, causing MAXPATHLEN to not be defined and the build to fail.

(cherry picked from commit cab31e0e216c7defefd4aba14693ba2252ea7308)
sbin/md5/md5.1
sbin/md5/md5.c
sbin/md5/tests/Makefile
sbin/md5/tests/coreutils-c-test.SH [new file with mode: 0644]