If file or directory name is ended dot (.) it losts "long name" and has only distorted, "hashed" short name. Lets make directory with last name and first name, for example, "Ivanov Ivan". Then I try use last name and abbreviation of first name, "Ivanov I." (abbreviation is dot-ended). On Windows side dot-ended name has distorted: N:\mangle_test>dir 08.03.2014 19:13 <DIR> . 08.03.2014 15:32 <DIR> .. 08.03.2014 19:13 <DIR> Ivanov Ivan 08.03.2014 19:13 <DIR> ID3EUP~Z Also on Windows side dot-ended name and has not short file name: N:\mangle_test>dir /X 08.03.2014 19:13 <DIR> . 08.03.2014 15:32 <DIR> .. 08.03.2014 19:13 <DIR> IIUDQI~Y Ivanov Ivan 08.03.2014 19:13 <DIR> ID3EUP~Z On FreeBSD side all correct: mangle_test>ls -1 Ivanov I. Ivanov Ivan mangle_test>ls -l total 8 drwxrwxr-x 2 user domain_users 512 8 мар 19:13 Ivanov I. drwxrwxr-x 2 user domain_users 512 8 мар 19:13 Ivanov Ivan Workaround: Set at smb.conf mangled names = no
Global parameters at smb.conf: mangling method = hash2 mangle prefix = 1 mangling char = ~ mangled names = Yes default case = lower case sensitive = Auto preserve case = Yes short preserve case = Yes
Unfortunately this is "Just The Way Windows Works" (tm) :-(. There is nothing Samba can do to fix this. Windows does not allow a file or directory name ending in a dot to be stored (try this on Windows). On a local filesystem it silently truncates the dot to make the name available to client code without the trailing dot. The only way we can make this available to clients is via the mangled name. As SMB2 doesn't use mangled names it might be interesting to test against a Windows server to see if names ending in dot are allowed to be created, or just return an invalid parameter. When I have some time I'll look into this, but it's a request for enhancement not a bug - as Samba is currently working as designed here. Jeremy.
Created attachment 9775 [details] Archive with dot-ended directory Directory "Ivanov I" has "1" subdirectory, directory "Ivanov I." has subdirectory "2"
(In reply to comment #2) > Unfortunately this is "Just The Way Windows Works" (tm) :-(. "Do not end a file or directory name with a space or a period. Although the underlying file system may support such names, the Windows shell and user interface does not. However, it is acceptable to specify a period as the first character of a name. For example, ".temp"." http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx#naming_conventions Explorer shows dot-ended directory correctly, but can't copy, move or just enter into this directory. (Explorer.jpg) Some file managers like Far Manager (http://www.farmanager.com/download.php?l=en) operates dot-ended directory as usual directory name. (Two directory.jpg) > When I have some time I'll look into this, but it's a request for enhancement > not a bug - as Samba is currently working as designed here. Sure, it is not a bug.
Created attachment 9776 [details] Explorer shows dot-ended name correctly
Created attachment 9777 [details] Far Manager shows two different directory
(In reply to Sergey from comment #5) see bug 11207 - windows allows trailing dots but this it's a windows bug that this is possible. The right way to to go is to map reserved names (like trailing dot), see bug 7001 and bug 11255 *** This bug has been marked as a duplicate of bug 7001 ***