Symlinks not visible via SAMBA/CIFS

Status
Not open for further replies.

SkyMonkey

Contributor
Joined
Mar 13, 2013
Messages
102
Hello,

I've been trying to make symlinks made on my NAS visible and transversable via CIFS. I have so far been unsuccessful.

My understanding is that this is possible by ensuring that the following parameters are selected:
  • In CIFS service options, uncheck "Unix Extensions".
  • In the share, add the following aux parameters:
Code:
follow symlinks = yes
wide links = yes


This does not seem to work in my situation.

Example:

Dataset media (/mnt/bluemesa/media) is shared as CIFS share 'media'. User Bryce is the owner of the share, and also the local login for the PC client.

Directories "foo" and "test" are created by a CIFS client at the root of media with user "Everyone" with full control (granted via Windows permission dialog). File foo.txt is created at /media/foo with similar permissions.

Logged into the freenas, the following commands are executed, creating a simlink.

Code:
/mnt/bluemesa/media/foo# ll
total 18
drwxrwxrwx+  2 Bryce  media_access   3 Dec 27 20:17 ./
drwx------+ 10 Bryce  media_access  12 Dec 27 20:16 ../
-rwxrwxrwx+  1 Bryce  media_access   0 Dec 27 20:17 foo.txt*
[root@freenas] /mnt/bluemesa/media/foo# ln -s foo.txt /mnt/bluemesa/media/test
[root@freenas] /# cd mnt/bluemesa/media/test
[root@freenas] /mnt/bluemesa/media/test# ll
total 18
drwxrwxrwx+  2 Bryce  media_access   3 Dec 27 20:19 ./
drwx------+ 10 Bryce  media_access  12 Dec 27 20:16 ../
lrwxr-xr-x   1 root   media_access   7 Dec 27 20:19 foo.txt@ -> foo.txt


As I understand things, this should make the file visible in Windows via CIFS in the test folder. It is not.

All googling and other reading I've done says this should work.

I've restarted CIFS, restarted the client PC, tried putting the "follow symlinks = yes" as a global parameter, and probably several other things I'm forgetting.

Any help would be much appreciated.

Relevent parts of smb4.conf:
Code:
[global]
    server max protocol = SMB2
    encrypt passwords = yes
    dns proxy = no
    strict locking = no
    oplocks = yes
    deadtime = 15
    max log size = 51200
    max open files = 468227
    syslog only = yes
    syslog = 1
    load printers = no
    printing = bsd
    printcap name = /dev/null
    disable spoolss = yes
    getwd cache = yes
    guest account = nobody
    map to guest = Bad User
    obey pam restrictions = yes
    directory name cache size = 0
    kernel change notify = no
    panic action = /usr/local/libexec/samba/samba-backtrace
    nsupdate command = /usr/local/bin/samba-nsupdate -g
    server string = FreeNAS Server
    ea support = yes
    store dos attributes = yes
    lm announce = yes
    unix extensions = no
    time server = yes
    acl allow execute always = true
    acl check permissions = true
    dos filemode = yes
    multicast dns register = yes
    domain logons = no
    local master = no
    idmap config *: backend = tdb
    idmap config *: range = 90000001-100000000
    server role = standalone
    netbios name = FREENAS
    workgroup = WORKGROUP
    security = user
    pid directory = /var/run/samba
    create mask = 0666
    directory mask = 0777
    client ntlmv2 auth = yes
    dos charset = CP437
    unix charset = UTF-8
    log level = 1
....
[media]
    path = /mnt/bluemesa/media
    printable = no
    veto files = /.snapshot/.windows/.mac/.zfs/
    writeable = yes
    browseable = yes
    recycle:repository = .recycle/%U
    recycle:keeptree = yes
    recycle:versions = yes
    recycle:touch = yes
    recycle:directory_mode = 0777
    recycle:subdir_mode = 0700
    shadow:snapdir = .zfs/snapshot
    shadow:sort = desc
    shadow:localtime = yes
    shadow:format = auto-%Y%m%d.%H%M-2w
    shadow:snapdirseverywhere = yes
    vfs objects = shadow_copy2 zfs_space zfsacl aio_pthread streams_xattr recycle
    hide dot files = no
    guest ok = no
    nfs4:mode = special
    nfs4:acedup = merge
    nfs4:chown = true
    zfsacl:acesort = dontcare
    follow symlinks = yes
    wide links = yes
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
If the symlinks point to locations within the same share then you don't need the widelinks parameter. I use symlinks regularly in CIFS shares without problem and without additional configuration. What are you trying to accomplish?
 

SkyMonkey

Contributor
Joined
Mar 13, 2013
Messages
102
I'm just trying to get symlinks working at all. This example is pretty much my current use case, but was simplified for purposes of examples and troubleshooting.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Okay. Simple example of how to make it work.
You've shared /mnt/Tank/Share
Your music folder is located in /mnt/Tank/Share/Music
You want /mnt/Tank/Share/Foo/Music to be a symlink to /mnt/Tank/Share/Music
Code:
mkdir /mnt/Tank/Share/Foo
ln -s /mnt/Tank/Share/Music/ /mnt/Tank/Foo/Music

Use full path.
 

SkyMonkey

Contributor
Joined
Mar 13, 2013
Messages
102
Huh, well apparently it was just the issue of using full paths on both source and destination. PEBKAC, as usual.

Thanks for the help!
 

SkyMonkey

Contributor
Joined
Mar 13, 2013
Messages
102
Hmm, I've found one other oddity...the symlinks don't always appear immediately. Sometimes there is a delay before they are visible on the windows client. Toggling the CIFS service appears to make them show up, but if I wait a while, they seem to regardless (in limited testing). When bringing the CIFS service back online to force the links to appear, the following appears in the console (ignore the possible deadlock, this has been a persistent error on my config for years; the tbd_transaction_commit is the new part).

Code:
Starting winbindd.
Dec 28 17:55:47 freenas winbindd[46811]: [2015/12/28 17:55:47.400466, 0] ../source3/winbindd/winbindd_cache.c:3196(initialize_winbindd_cache)
Dec 28 17:55:47 freenas winbindd[46811]: initialize_winbindd_cache: clearing cache and re-creating with version number 2
Dec 28 17:55:47 freenas winbindd[46811]: [2015/12/28 17:55:47.403469, 0] ../lib/util/become_daemon.c:136(daemon_ready)
Dec 28 17:55:47 freenas winbindd[46824]: STATUS=daemon 'winbindd' finished starting up and ready to serve connectionstdb(/var/db/samba4/winbindd_idmap.tdb): tdb_transaction_commit: transaction error pending
Dec 28 17:55:47 freenas smbd[46807]: [2015/12/28 17:55:47.499572, 0] ../lib/util/become_daemon.c:136(daemon_ready)
Dec 28 17:56:28 freenas winbindd[46812]: STATUS=daemon 'winbindd' finished starting up and ready to serve connectionssam_rids_to_names: possible deadlock - trying to lookup SID S-1-5-21-626537768-3214805501-4061107804
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
If you haven't done it yet, remove the auxiliary parameters you added (widelinks = yes, follow symlinks =yes). The symlinks shouldn't be causing winbind errors, but the above parameters mag be causing some goofy behavior.
 

SkyMonkey

Contributor
Joined
Mar 13, 2013
Messages
102
Thought I at least needed 'follow symlinks = yes' to get them to work at all...
 
Status
Not open for further replies.
Top