Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use md5sum rather than gmd5sum for FreeBSD #3994

Merged
merged 1 commit into from
Apr 1, 2024
Merged

Use md5sum rather than gmd5sum for FreeBSD #3994

merged 1 commit into from
Apr 1, 2024

Conversation

sunpoet
Copy link
Contributor

@sunpoet sunpoet commented Mar 27, 2024

FreeBSD has md5sum in the base system. It also avoids the hack for gmd5sum.

Reference: https://man.freebsd.org/cgi/man.cgi?query=md5sum

@Cyan4973
Copy link
Contributor

I wonder why there was a contribution to employ gmd5sum on FreeBSD, at a time when md5sum was our default ?
It implied that md5sum was not a good default for FreeBSD at the time ?
(Note: this contribution was made by @DimitryAndric in #475. Feel free to weight in)

Also, looking around on this topic, I see this sentence :

Use md5 on FreeBSD. The standard command for calculating MD5 checksums on FreeBSD systems is md5, not md5sum or gmd5sum.

And now I'm even more confused.

@Cyan4973 Cyan4973 self-assigned this Mar 28, 2024
@DimitryAndric
Copy link
Contributor

I think #475 was because we didn't have a GNU compatible md5sum command in base at the time, but only a slightly incompatible md5 command (it produces md5 hashes obviously, but its output is different than GNU md5sum's).

Now all supported FreeBSD versions (I think from 13.x onwards) do have a md5sum command that behaves similarly to the GNU version.

@dearblue
Copy link
Contributor

For reference.
The md5sum command was introduced with the md5 -r switch on FreeBSD in 13.1 (2022-05-16) or 14.0 (2023-11-20).

In addition, currently supported FreeBSD versions are 14.0, 13.3 and 13.2 (end of life is 2024-06-30).

Finally, a small difference between md5sum and md5 -r is quoted from the manual.

difference between `md5sum` and `md5 -r`

from: https://man.freebsd.org/cgi/man.cgi?query=md5sum&manpath=FreeBSD+14.0-RELEASE+and+Ports

Calculate the checksum of multiple files reversing the output:

      $ md5 -r /boot/loader.conf /etc/rc.conf
      ada5f60f23af88ff95b8091d6d67bef6 /boot/loader.conf
      d80bf36c332dc0fdc479366ec3fa44cd /etc/rc.conf

This is almost but not quite identical to the output from GNU mode:

      $ md5sum /boot/loader.conf /etc/rc.conf
      ada5f60f23af88ff95b8091d6d67bef6  /boot/loader.conf
      d80bf36c332dc0fdc479366ec3fa44cd  /etc/rc.conf

Note the two spaces between hash and file name.

@Cyan4973 Cyan4973 merged commit e3566d6 into facebook:dev Apr 1, 2024
93 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants