My file server, running TrueNAS CORE 13.0-U6.2 and delivering files to macOS clients via SMB, was mangling a number of filenames to DOS 8.3 format when presenting them to macOS clients. When I listed the same names on the same server connected via AFP, the names were not mangled. Likewise, when I listed the same names directly from the TrueNAS shell, the names were not mangled.
Taking a hint from another post, I modified the configuration of the SMB share. In TrueNAS admin UI, tab “Sharing” > “Windows Shares (SMB)”, I selected the share in question, from its 3-dot menu selected “Edit”, clicked the “Advanced Options” button, then checked the box labelled “Use Apple-style Character Encoding”. This was successful; the TrueNAS server started displaying full filenames instead mangled 8.3 filenames to the macOS clients.
So this seems to work. OK, why? What I would really like is some explanation that the behaviour I saw was expected Samba behaviour, and that the TrueNAS checkbox definitively stops Samba from serving my macs 8.3 filenames.
The help for the “Use Apple-style Character Encoding” checkbox says, “By default, Samba uses a hashing algorithm for NTFS illegal characters. Enabling this option translates NTFS illegal characters to the Unicode private range.” The TrueNAS documentation for this option does not add anything more.
But the filenames which got presented as 8.3 on macOS did not include NTFS illegal characters. Most were moderately long, 50-100 characters. Many had ASCII quote marks. Some had non-ASCII accented Latin script letters. I don’t see how illegal character handling would be relevant.
There is Samba documentation for smbd.conf options controlling name mangling. They include mangled names
and preserve case
. Does the TrueNAS option set some of these smbd.conf options?
Is there source code implementing this TrueNAS checkbox which I can examine? I took a look at the TrueNAS repos in GitHub and did not find a clear answer.
Thanks for you help! —Jim