CIFS & MAC problems with special characters in folder names

Constantin

Vampire Pig
Joined
May 19, 2017
Messages
1,829
thanks but as I've said I don't run freenas/truenas anymore. Would you mind sharing what the "?" reveals next to that "Apple Style Character Encoding" option? I guess in the background it will set one of the 2 smb options I have mentioned earlier.

Here you go.

Screen Shot 2021-05-27 at 9.25.23 AM.png
 

ovizii

Patron
Joined
Jun 30, 2014
Messages
435
Those above catia mappings are incomplete. Depending on whether vfs_fruit is enabled it will either set fruit:encoding = native, or add the catia mappings that fruit sets.
Code:
FRUIT_CATIA_MAPS = [
    "0x01:0xf001,0x02:0xf002,0x03:0xf003,0x04:0xf004",
    "0x05:0xf005,0x06:0xf006,0x07:0xf007,0x08:0xf008",
    "0x09:0xf009,0x0a:0xf00a,0x0b:0xf00b,0x0c:0xf00c",
    "0x0d:0xf00d,0x0e:0xf00e,0x0f:0xf00f,0x10:0xf010",
    "0x11:0xf011,0x12:0xf012,0x13:0xf013,0x14:0xf014",
    "0x15:0xf015,0x16:0xf016,0x17:0xf017,0x18:0xf018",
    "0x19:0xf019,0x1a:0xf01a,0x1b:0xf01b,0x1c:0xf01c",
    "0x1d:0xf01d,0x1e:0xf01e,0x1f:0xf01f",
    "0x22:0xf020,0x2a:0xf021,0x3a:0xf022,0x3c:0xf023",
    "0x3e:0xf024,0x3f:0xf025,0x5c:0xf026,0x7c:0xf027"
]
Thanks, that is a lot of good info here. So for running samba on linux and serving the same shares to Win10 and OSX clients and also having local apps on the linux host directly accessing these folders, what solution would you suggest?

will enabling vfs_fruit and setting fruit:encoding = native prevent issues arising from 3 OSes accessing the same folders/files?

(I know there is much more to running a proper samba server but I think that apart from the encoding question I am sorted)
 

Constantin

Vampire Pig
Joined
May 19, 2017
Messages
1,829
There's no explicit need to change samba's default name mangling behavior
Apologies, @anodos but was your response meant for me or @ovizii? I presume it's the latter but wanted to confirm as I observed some severe mangling by SMB in FreeNAS 11 of ZFS content that displayed fine in AFP. Similarly, all issues I encountered in FreeNAS with SMB and TimeMachine also seem to have resolved in TrueNAS 12. Thank you!
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Apologies, @anodos but was your response meant for me or @ovizii? I presume it's the latter but wanted to confirm as I observed some severe mangling by SMB in FreeNAS 11 of ZFS content that displayed fine in AFP. Similarly, all issues I encountered in FreeNAS with SMB and TimeMachine also seem to have resolved in TrueNAS 12. Thank you!
It's a general comment. MacOS clients over SMB will do its own name mangling (see catia mapping). There's no strict requirement to undo mangling before writing to disk (though it makes shell scripting more fun). The key thing is to be consistent with how you handle it since this impacts on-disk xattr and file names.

That said, I'm glad that the feature helps you. Goal with 12 and later is to make this stuff somewhat easier.
 

Constantin

Vampire Pig
Joined
May 19, 2017
Messages
1,829
interesting. Presumably, having that box checked with a Mac-only computer stable interfacing with the NAS makes sense, right?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
interesting. Presumably, having that box checked with a Mac-only computer stable interfacing with the NAS makes sense, right?
Yeah, I'd say in a Mac-only environment, it makes sense to use that encoding option. It makes life easier for admins. If you're transitioning from AFP to SMB, I'd say it's probably a requirement (to keep encoding consistent between the two).
 

Jip-Hop

Contributor
Joined
Apr 13, 2021
Messages
118
Is there an SMB option to make files/directories ending in a space or dot work with MacOS?

I'm moving from AFP to SMB and wrote Samba Police to help me detect which files are missing/mangled when accessing over SMB. When I set "Use Apple-style Character Encoding", the mangling issues go away. But some files are now completely missing (instead of mangled). That's even worse in my opinion...

Most of the missing files have a dot or space as the last character in their name. So I'm wondering if there's an option to make these files work as well in combination with "Use Apple-style Character Encoding"...

Tested on TrueNAS SCALE.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Is there an SMB option to make files/directories ending in a space or dot work with MacOS?

I'm moving from AFP to SMB and wrote Samba Police to help me detect which files are missing/mangled when accessing over SMB. When I set "Use Apple-style Character Encoding", the mangling issues go away. But some files are now completely missing (instead of mangled). That's even worse in my opinion...

Most of the missing files have a dot or space as the last character in their name. So I'm wondering if there's an option to make these files work as well in combination with "Use Apple-style Character Encoding"...

Tested on TrueNAS SCALE.
It's really a better option to stick with naming conventions that are compatible cross-platform. If you name things with illegal NTFS characters then WIndows clients won't be able to view them.
 
Top