GNU md5sum accepts the following with identical semantics: echo "foo" | md5sum echo "foo" | md5sum - FreeBSD md5sum rejects the second, because it looks for a file named "-". This trips up scripts that rely on the GNU behaviour. Since the FreeBSD md5sum is meant to be compatible to the GNU counterpart, it would be great if the behaviour could be changed! Thank you very much!
Uploaded a possible fix to https://reviews.freebsd.org/D43807
Thanks for the quick fix :)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=72ee91fed4cfdcfbfb767cc166370b40e50d446a commit 72ee91fed4cfdcfbfb767cc166370b40e50d446a Author: Dag-Erling Smørgrav <des@FreeBSD.org> AuthorDate: 2024-02-16 12:36:58 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2024-02-16 12:37:29 +0000 md5: Accept "-" as alias for stdin. (based on a patch by jhb) MFC after: 1 week PR: 276915 Reported by: Hannes Hauswedell <h2+fbsdports@fsfe.org> Reviewed by: allanjude, markj, jhb, emaste Differential Revision: https://reviews.freebsd.org/D43870 sbin/md5/md5.1 | 7 ++++++- sbin/md5/md5.c | 12 +++++++++--- sbin/md5/tests/md5_test.sh | 10 ++++++++++ 3 files changed, 25 insertions(+), 4 deletions(-)
^Triage: reassign to committer and set flags for possible MFCs.
13 has a different code base.
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=1288891878d9a194af8c170bb6a33c06e306e0e0 commit 1288891878d9a194af8c170bb6a33c06e306e0e0 Author: Dag-Erling Smørgrav <des@FreeBSD.org> AuthorDate: 2024-02-16 12:36:58 +0000 Commit: Dag-Erling Smørgrav <des@FreeBSD.org> CommitDate: 2024-02-24 12:12:49 +0000 md5: Accept "-" as alias for stdin. (based on a patch by jhb) MFC after: 1 week PR: 276915 Reported by: Hannes Hauswedell <h2+fbsdports@fsfe.org> Reviewed by: allanjude, markj, jhb, emaste Differential Revision: https://reviews.freebsd.org/D43870 (cherry picked from commit 72ee91fed4cfdcfbfb767cc166370b40e50d446a) md5: Ignore files in string and passthrough mode. MFC after: 1 week Reviewed by: allanjude, markj Differential Revision: https://reviews.freebsd.org/D43871 (cherry picked from commit 5b44edb4058365ba8e4ccfdb5176c1cddd4394fe) md5: Clean up input stream rights. Keep it simple, caph_limit_stdio() and fileargs_fopen() already take care of everything for us. MFC after: 1 week Reviewed by: markj, jhb, emaste Differential Revision: https://reviews.freebsd.org/D43897 (cherry picked from commit 17d5b027c1921d0c6ba2de7993dd808dbf4df078) md5: Add test case for GNU input modes. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude, markj Differential Revision: https://reviews.freebsd.org/D43988 (cherry picked from commit e7308a60a5b77a1e4aff6e27eddef40fedabb98c) md5: Fix Perl mode long options. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: imp, allanjude, markj Differential Revision: https://reviews.freebsd.org/D43989 (cherry picked from commit 4db7ca24470576948e33f48033cfa5be2749950e) md5: Fix GNU check mode. Fixes: 9b20849bc5f1b500f2de7aeca77f0e6556069bbb MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: imp, allanjude, markj Differential Revision: https://reviews.freebsd.org/D43990 (cherry picked from commit c05533d97ac178f8e811407860d47d3c0ae61eed) md5: Untabify declarations. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: imp, allanjude, markj Differential Revision: https://reviews.freebsd.org/D43991 (cherry picked from commit 702f133fa18185a7e10e66316e8f158be935b696) sbin/md5/md5.1 | 9 +++- sbin/md5/md5.c | 101 +++++++++++++++++++++++---------------------- sbin/md5/tests/md5_test.sh | 35 ++++++++++++++++ 3 files changed, 95 insertions(+), 50 deletions(-)