SAMBA shares and symbolic links - different than other questions!

Hi there,
this isn’t a general Garuda phenomena, but a samba phenomena.

I’m using the Garuda machine as a “translator” for network stuff. It has two network cards.

One network card is connected to the network where my NAS is, along with modern machines like Windows 11 etc. The NAS is a Windows 11 machine. I have set up a share on the NAS. It can be accessed without problems by all windows machines. It can be accessed by Garuda linux without any problems.

The second network interface of the Garuda machine is connected to my retronet along with Win9x and WinXP machines. I don’t want these old machines on my normal network for security reasons.

I used /etc/fstab to successfully mount the NAS share in /home/myuser/winnet, and on linux i can access everything just fine!

I set up a samba server on the Garuda machine.

I set /home/myuser/winnet up as a samba share. The old Windows machines can access the server but there are some problems:

Lets say i have the following structure on my nas (Win11):
The name of the share is myshare and is accessible through smb://nas/myshare

inside myshare i have dirA, which is a normal directory inside myshare.
inside myshare i have dirB, which is a symlink to somewhere outside of the myshare directory on the server.

Linux can follow the symlink without problems. It works using the share (/home/myuser/winnet) directly in dolphin/terminal or accessing it through dolphin through the samba server as in smb://thislinuxmachine in dolphin.
The old windows clients can only access dirA. Trying to access dirB windows complains about the data not being available.

I used ubuntu 22.04 earlier on this machine and it worked perfectly until i did a distro upgrade to 24.0x. No config files have been changed but the above described problems started to occur. My newly installed Garuda Linux has the same problems - so i guess its a thing which was introduced by samba updates?!

Garuda is my fav distro and id like to use it from now on - that’s why im asking here for help.

Thank you for your time :slight_smile:

PS - i already tried things like
unix extensions = yes/no
follow symlinks = yes
wide links = yes
allow insecure wide links = yes

Recent versions of Samba restrict the use of symlinks, particularly the wide links option, because of the potential security risks. If you’re confident about the security of your environment, you can enable allow insecure wide links = yes.

Note: it should be added in the [global] section of the config, not for a specific share. Samba: allow insecure wide links - Server Fault

As for the old Windows boxes, Windows 9x and Windows XP don’t natively understand Unix-style symlinks. When the client accesses a Samba share, it treats symlinks as regular files or directories. If the symlink points to a location outside of the shared directory structure or if the target of the symlink isn’t accessible by the Windows machine, it will just shrug and tell you it’s not there.

To get it working for those old Windows rigs you may need to scrap the symlinks and use bind mounts instead.

3 Likes

Thanks for your reply :slight_smile:
I tested some more and i think it’s not about samba but more about cifs. It started to behave different:

When i mount the share with the symlinks in it, cifs mounts all symlinks as new mounts…
So instead of one mount point with a remote filesystem mounted i get as many mount points as there are symlinks. It didn’t do that before…

And with this behaviour the samba problems for the older windows machines started…

For me it seems like earlier versions of cifs made it possible for samba and dolphin/console to see the symlinks as plain directories without being any special. And that worked really well.