Linux – Samba share yielding “invalid handle”

linuxsambawindows

I have a strange behavior that came up suddenly with a samba share (arch linux) since yesterday. The only trigger that I can think of is a system update (pacman -Syu). Ever since, the root share (/) is accessible and all directories are visible but any attempt to access any of the directories triggers an "invalid handle" response in Windows. If I however share any of the directories (e.g. /data) as a separate share, it is fully accessible without trouble. Here is the share definition.

In the meantime, I have isolated the issue to the Samba server (rather than the Windows host). A second Arch Linux installation will mount the [data] share correctly, but will refuse access to the root [/data/root_ssd] share. Conversely, starting Samba on this new, virgin Arch Linux install will again lead to no sharing of the root path.

Any ideas? It seems to me that this behavior is new to a recent Samba upgrade.

    [antergos1-festplatte]
    comment = 20 GB Festplatte
    path = /
    writeable = yes
    create mask = 0766
    directory mask = 0777
    guest ok = yes
    force user = aag
    browseable = yes

    [data]
    comment = webserver directories
    path = /data
    writeable = yes
    create mask = 0777
    directory mask = 0777
    guest ok = yes
    force user = aag
    browseable = yes
    force group = admins

Best Answer

This behavior comes with the latest Samba security updates. I just encountered it with Debian Wheezy. It seems that fixing CVE-2015-5252 either intentionally or inadvertently blocks root level shares (/).

As a workaround, you can set in smb.conf
[global]
unix extensions = no
[share]
wide links = yes

Note: unix extension = yes, which is the default, would disable wide links.