SMB not case preserving with macOS clients (on SCALE with default config!)

Hi all.

SMB should be case insensitive, but case preserving. At least with Windows and macOS clients.

On the other hand, TrueNAS is not case preserving with macOS clients (I have tested with 12 Monterey, 14 Sonoma and 15 Sequoia BETA).

I have tried to use the default configuration. That is:

  1. Create a local User, activating “Samba Authentication”.

  2. Create a dataset (using the “SMB” preset) → So it will be casesensitivity insensitive and aclmode restricted.

  3. Start the vanilla “SMB” server (all default, even without using “Enable Apple SMB2/3 Protocol Extensions”, although this does not change the result).

  4. Access from macOS, using the Finder, and the user created in point 1.
    4.1. Create a directory called test (all lowercase).
    4.2. Try to rename it to Test (i.e. first letter in upper case).
    4.3. The renaming seems to work, but…
    4.4. …immediately, it fails silently and the name reverts to test (all lowercase).

b1

b2

1 Like

And last screen-capture, where Test reverts to test (all lowercase).

b3

What if you first change it to “Test_” and then to “Test”?

1 Like

Of course, that work around works, but it is not the usual procedure :smiley:

I suspect that the issue is with “null renaming” when case insentivity is factored in, and forcing actual renamings is the workaround.

(Of course, real filesystems are case sensitive…)

Ah. Another change in MacOS behavior. Dir was named foo and trying to rename to Foo

----
# Packet 62 from C:\Users\15805\Desktop\smb.pcap
<snip>
- Create Request File: Foo;SetInfo Request FILE_INFO/SMB2_FILE_RENAME_INFO NewName:Foo;Close Request

So now rather than getting a handle with the name returned via the directory listing it just performed (foo), it’s using using Foo and then renaming to Foo which hits a micro-optimization in samba for when a client tries to rename a file to its current name. Since our SMB CI tests do the sane thing (use the file name returned in the dir listing) this issue was not caught.

1 Like

Thanks @awalkerix for taking a look. Nice catch.

Do you think it can be fixed? I have created a bug report: https://ixsystems.atlassian.net/browse/NAS-130743

I’m testing fix right now, but it may have to wait for EE unless we need to do a hotfix for other reasons for DF 24.04.2.

1 Like

Code fixes are merged for next nightlies. I’ll queue fix for 13.3-U1 later this week (but ETA on that is a ways out).

3 Likes

Awesome @awalkerix! So fast! Thank you so much.
It was a really annoying issue!