HomeFreeBSD

sbin/md5.c: fix -q -c for BSD style versions

Description

sbin/md5.c: fix -q -c for BSD style versions

The BSD style commands (with names not ending in "sum") ignored the -c
options and the passed digest value when invoked with -q.

The man page stated that -q causes only the calculated digest to be
printed, but did not consider the case of both the -q and -c being
used in combination.

Since there is no warning that -c will be ignored when the -q option
is used, users night (and did) expect that the exit code would reflect
the matching of the calculated digest and the argument passed with -c.

This update implements and documents this expected behavior.

PR: 265461
Reported by: Dmitrij <bugs.freebsd@1fff.net>
MFC after: 2 weeks

(cherry picked from commit 9f3aa538e307743b2b5048d38f87b7fd32d0c596)

Details

Provenance
seAuthored on Jul 26 2022, 9:04 PM
Parents
rGd9eb7677942f: update external URLs
Branches
Unknown
Tags
Unknown