The Samba-Bugzilla – Bug 3666
Name mangling incorrect
Last modified: 2006-04-10 10:54:48 UTC
Short Names are mangled incorrectly. According to the docs I've read the convention is five letters of the file name and a tilde and then two letters from a hash of the entire file name, then a period and the extension.
Here's an example of what's occuring:
01/17/2006 01:16 PM <DIR> CRT6BY~Q Conferences
10/04/2005 03:38 PM <DIR> CF0BW7~R Committees
01/11/2006 02:49 AM <DIR> P5UBMN~9 PastPerformance
04/07/2006 03:20 PM <DIR> LNLYW2~O LabRawData
From the looks of it, the entire thing seems to end up a hash of the file name. This makes it so it's exteremely hard for users to find their files when using older software with mapped network drives.
The default name mangling algorithm Samba uses changed. There are several things you can change to make the mangling look more like Windows. Look into the
"mangle prefix" option, plus you can change the mangling back to the old algorithm by setting "mangling method = hash" instead of the default "mangling method = hash2"
This is really a docs bug, not a code bug.
I feel this is a bug as the name is now just a hash by default. Having a default value of 1 letter preserved is rather silly. Also, the Tilde no longer separates the hash from the preserved characters.
As mentioned, it's a docs bug not a code bug. It's working as designed.
Designs can have bugs also, this is a design bug. The default should NOT be 1 letter of prefix as the purpose of a short file name is to provide compatibility to old software which requires 8.3 filenames while still allowing users to locate their files. Yes, from your programmer's perspective it might be perfectly reasonable to have the entire 8.3 filename as a hash to prevent collision, it is, however, at odds with nessesity.
For example, none of the users of our samba server could locate any of their directories when using FoxPro 2.6 and the new default hashing mechanism. What is the point of the default, if it is always required to be changed in order to provide usefullness?