Bug 295875 - md5 mangles filenames containing non-ASCII characters
Summary: md5 mangles filenames containing non-ASCII characters
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 15.1-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: Dag-Erling Smørgrav
URL: https://reviews.freebsd.org/D57562
Keywords:
Depends on:
Blocks:
 
Reported: 2026-06-05 14:58 UTC by Martin Birgmeier
Modified: 2026-06-26 15:53 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Birgmeier 2026-06-05 14:58:22 UTC
Scenario:
- FreeBSD stable/15 at 6146c5962e5c
- LANG environment variable set to C.UTF-8
- No LC_* environment variable set
- The filesystem (ZFS) is using UTF-8 character encoding for filenames
- Running md5 -r копия.doc

Result:
- The following is output:

0123456789abcdef0123456789abcdef \320\272\320\276\320\277\320\270\321\217.doc

Expected result:
- The following should be output:

0123456789abcdef0123456789abcdef копия.doc

Note:
- In /usr/src/sbin/md5/md5.c, the function "safename()" is used to mangle filenames. This should be replaced by a saner check which also considers international characters based on the environment settings for LANG and LC_*.

-- Martin
Comment 1 Nick Price 2026-06-13 18:56:03 UTC
Fix submitted in D57562