TrueNAS 12 SMB share oddities

jdrouhard

Cadet
Joined
Nov 11, 2020
Messages
3
Hi all!

Just upgraded to TrueNAS Core 12! Very exciting! Everything is working great except for one thing I can't quite figure out. This worked on 11.3, so it's something in the new samba stack, but here goes:

I have an SMB share called "media." This is of course the same as the local user "media" though the two should be distinct. This share always worked fine in 11.3 from macOS and Windows clients. After upgrading to 12, however, connecting to this share actually connects to my home share:

Code:
# testparm
Load smb config files from /usr/local/etc/smb4.conf
Loaded services file OK.
Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters
[global]
#...
[homes]
        browseable = No
        ea support = No
        kernel share modes = No
        path = /mnt/metalmind/home/%U
        posix locking = No
        read only = No
        vfs objects = aio_fbsd fruit streams_xattr shadow_copy_zfs ixnas
        fruit:resource = stream
        fruit:metadata = stream
        nfs4:chown = true

[media]
        ea support = No
        kernel share modes = No
        path = /mnt/metalmind/media
        posix locking = No
        read only = No
        vfs objects = aio_fbsd fruit streams_xattr shadow_copy_zfs ixnas
        fruit:resource = stream
        fruit:metadata = stream
        nfs4:chown = true


Code:
# smbclient -U john \\\\localhost\\media -c ls
Enter WORKGROUP\john's password:
  .                                   D        0  Wed Nov 11 20:14:12 2020
  ..                                  D        0  Mon Jul  1 17:02:31 2019
  .rhosts                            AH      212  Fri Jun 28 08:43:04 2019
  .login_conf                        AH       91  Fri Jun 28 08:43:04 2019
  .ssh                               DH        0  Sat Sep 26 09:21:03 2020
// etc...etc...


Changing the share name to anything else, or disabling my home share seems to make the media share work correctly:

Code:
# testparm
Load smb config files from /usr/local/etc/smb4.conf
Loaded services file OK.
Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters
[global]
#...
[media]
#...

# smbclient -U john \\\\localhost\\media -c ls
Enter WORKGROUP\john's password:
  .                                   D        0  Wed Nov 11 20:02:08 2020
  ..                                  D        0  Fri Jun 28 17:59:49 2019
  music                               D        0  Wed Nov 11 20:08:01 2020
  tv                                  D        0  Sat Sep 26 09:19:49 2020
  movies                              D        0  Tue Nov 10 15:34:39 2020


In the logs, here's what I get when both homes and media are enabled:
Code:
....
  get_referred_path: |media| in dfs path \localhost\media is not a dfs root.
[2020/11/11 20:28:23.334819,  3] ../../source3/smbd/smb2_server.c:3280(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_NOT_FOUND] || at ../../source3/smbd/smb2_ioctl.c:312
[2020/11/11 20:28:23.334887,  3] ../../source3/smbd/service.c:1152(close_cnum)
  shadesmar (ipv4:127.0.0.1:32061) closed connection to service IPC$
[2020/11/11 20:28:23.334994,  3] ../../lib/util/access.c:371(allow_access)
  Allowed connection from 127.0.0.1 (127.0.0.1)
[2020/11/11 20:28:23.335034,  3] ../../source3/smbd/service.c:631(make_connection_snum)
  make_connection_snum: Connect path is '/mnt/metalmind/home/john' for service [media]


and here's the same part of the log when homes is disabled:

Code:
...
  get_referred_path: |media| in dfs path \localhost\media is not a dfs root.
[2020/11/11 20:50:59.029544,  3] ../../source3/smbd/smb2_server.c:3280(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_NOT_FOUND] || at ../../source3/smbd/smb2_ioctl.c:312
[2020/11/11 20:50:59.029753,  3] ../../source3/smbd/service.c:1152(close_cnum)
  shadesmar (ipv4:127.0.0.1:31527) closed connection to service IPC$
[2020/11/11 20:50:59.029866,  3] ../../lib/util/access.c:371(allow_access)
  Allowed connection from 127.0.0.1 (127.0.0.1)
[2020/11/11 20:50:59.029901,  3] ../../source3/smbd/service.c:631(make_connection_snum)
  make_connection_snum: Connect path is '/mnt/metalmind/media' for service [media]


I think it likely has something to do with the "media" user being a local user on the system as well as the share name (plus homes being enabled), but this setup worked fine on 11.3 and I'd prefer to keep this naming scheme with the same settings if at all possible. If you need more of the logs or configs, let me know. I tried to snip the interesting bits out as much as I could but I might have left somethign important out.

Thanks for all your help!
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554

jdrouhard

Cadet
Joined
Nov 11, 2020
Messages
3
I'm curious what change caused it to break in the first place? Guess there is quite a bit of churn on the samba source code so probably some refactor or new feature led to the regression? Thanks for the link to the fix. Which version of samba was it fixed in?
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
I'm curious what change caused it to break in the first place? Guess there is quite a bit of churn on the samba source code so probably some refactor or new feature led to the regression? Thanks for the link to the fix. Which version of samba was it fixed in?
On our side we switched smb.conf backends for shares and in this case there was a quite old bug (more than 10 years). I fixed in upstream master, but didn't backport to 4.12-stable / 4.13-stable. So it won't hit major samba releases until probably 4.14 unless someone wants to backport. I fixed in our own samba port for 4.12/4.13.
 
Top