18

Here is our current setup:

Mac OS X 10.5.8 File server using Mac OS Extended (Journaled) file system. There is a share that is shared over AFP (For Mac desktops) and Samba for (Windows desktops).

Here is what is happening:

All GFX designers use Mac and create folders/files on the file server over AFP and programmers access those files using samba. Sometimes files and folders appear with weird names and become inaccessible to those connecting over samba.

enter image description here

enter image description here

enter image description here

The only way to make the created folder accessible is go back onto a Mac desktop got to the location of the folder, create a new folder and move the contents of broken folder to the new one.

On the Mac desktops they can access the folders perfectly fine and the folder/file name appears as they were created. It's just PC users accessing over Samba that has the file/folder issue. Whats weird is that this happens at random and I cannot find any reason why some files folder end up not working for samba users. I suspect that the mac users are doing something to that file/folder such as adding a flag or some property thats compatible with the Mac file system but causes problems with samba.

So my question:

What causes this issue? Is there a permanent fix? If not is there a way I can train the Mac uses to stop them causing the issues for samba users?

2 Answers 2

29

It's a file name mangling problem. Samba is converting filenames down to old style DOS 8.3 filenames.

Edit /etc/smb.conf (*) and add mangled names=no to the [global] section and restart the smb service.

Reference: http://oreilly.com/openbook/samba/book/ch05_04.html


(*) if the file is not there, type locate smb.conf to find it. Type sudo updatedb if locate does not find it and try again.

3
  • 1
    Some files became invisible after this. What could be the case? (Server on linux, browsing on mac)
    – MrCheatak
    Nov 28, 2022 at 10:15
  • Alright, seems like mangle names = no hides the files. In order to be able to browse them, Windows-incompatable characters (:, / etc) have to be substituted with vfs catia. This article helped: zderadicka.eu/what-is-this-weird-file-name-in-my-samba-share
    – MrCheatak
    Nov 28, 2022 at 18:47
  • I had the same issue and this solved my problem. But what I do not understand, is that it affected only certain files and directories (all written by the same application). Is there any indication why the behavior is not consistent for all (long) names ?
    – Waldorf
    Jan 10, 2023 at 18:27
2

Came across this while looking for visibly the same issue but unrelated to Samba or any other specific file sharing utility.

(It took me a bit of google work to find this page which is why I'm adding my new answer for anyone else who finds this like I did)

The problem was only affecting a single user's directories (when viewed by others) and every mangled directory name was in the format of six(6) uppercase characters or numbers, one(1) ~ (tilde), followed by a single uppercase character or number.

Examples:

G2X4IA~5
O2T3KH~K
SYJ2IT~R

Solution:

The MAC user(s) in question should stop using trailing spaces and/or special characters in directory names. That's it. Almost every one of the directories in question had a trailing space, and the rest had a trailing special character (one actually had both which was a good test case). Simply removing them immediately cleared things up.

1
  • 1
    Thank you, this was the case for me to, a directory with a trailing space in its name. Setting mangled names=no in smb.conf let me view the file as is on the macOS client, including the trailing space. Oct 19, 2017 at 23:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .