Page MenuHomeFreeBSD

md5: Treat a filename of '-' as stdin
AbandonedPublic

Authored by jhb on Feb 9 2024, 7:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Sep 26, 7:12 PM
Unknown Object (File)
Aug 26 2025, 1:17 AM
Unknown Object (File)
Jul 23 2025, 1:19 PM
Unknown Object (File)
Jul 13 2025, 3:17 PM
Unknown Object (File)
Jul 5 2025, 7:41 PM
Unknown Object (File)
Jul 1 2025, 7:24 PM
Unknown Object (File)
Jun 28 2025, 8:05 PM
Unknown Object (File)
Jun 28 2025, 1:10 PM
Subscribers

Details

Reviewers
des
imp
Summary

PR: 276915
Reported by: Hannes Hauswedell <h2+fbsdports@fsfe.org>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 55888
Build 52777: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Feb 9 2024, 7:39 PM

Do other md5/md5sum have this feature?
Does it need a mention in the man page?
Assuming yes,no, I'm good. But I'm also good with you sorting out the impact of my questions if there is any

This revision is now accepted and ready to land.Feb 9 2024, 7:43 PM

The bug noted that GNU's md5sum permits - as a filename for stdin.

I'll take care of the man page and tests in a separate commit.

sbin/md5/md5.c
641

Should we check that f != stdin here? If we do, md5 - - foo will print the digest of whatever is on stdin, then the digest of the empty string, then the digest of foo. If we don't, it will print the digest of whatever is on stdin and then error out on EBADF without looking at foo.

D43870 has this + fclose() check + doc and test changes.