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)
Nov 20 2024, 9:05 AM
Unknown Object (File)
Oct 22 2024, 3:15 PM
Unknown Object (File)
Oct 19 2024, 1:16 PM
Unknown Object (File)
Oct 6 2024, 8:16 AM
Unknown Object (File)
Sep 17 2024, 1:03 PM
Unknown Object (File)
Sep 8 2024, 6:53 PM
Unknown Object (File)
Sep 6 2024, 10:11 AM
Unknown Object (File)
Aug 30 2024, 10:31 AM
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.