Univention Bugzilla – Bug 44891
samba does not follow symlinks
Last modified: 2017-07-05 13:06:41 CEST
Testenvironment: 10.200.6.100 Capturefile Loglevel 10 (at the testenvironment): /var/log/samba/log.smbd_ISSUE tested symlink: /var/shares/testshare/symlink Steps to reproduce: - create a share - create a folder in the share - create a symlink to the folder in the share - try to access the symlink Samba4 seems to not follow symlinks anymore. The log.smbd shows the following snippet: [...] [2017/06/29 09:31:38.196585, 5, pid=8504, effective(2013, 5001), real(2013, 0)] ../source3/smbd/files.c:128(file_new) allocated file structure fnum 1781595142 (3 used) [2017/06/29 09:31:38.196608, 10, pid=8504, effective(2013, 5001), real(2013, 0)] ../source3/smbd/files.c:756(file_name_hash) file_name_hash: /var/shares/testshare/symlink hash 0x7e452811 [2017/06/29 09:31:38.196635, 10, pid=8504, effective(2013, 5001), real(2013, 0), class=vfs] ../source3/smbd/vfs.c:1190(check_reduced_name) check_reduced_name: check_reduced_name [symlink] [/var/shares/testshare] [2017/06/29 09:31:38.196662, 10, pid=8504, effective(2013, 5001), real(2013, 0), class=vfs] ../source3/smbd/vfs.c:1250(check_reduced_name) check_reduced_name realpath [symlink] -> [/var/shares/testshare/testfolder] [2017/06/29 09:31:38.196675, 5, pid=8504, effective(2013, 5001), real(2013, 0), class=vfs] ../source3/smbd/vfs.c:1337(check_reduced_name) check_reduced_name: symlink reduced to /var/shares/testshare/testfolder [2017/06/29 09:31:38.196697, 10, pid=8504, effective(2013, 5001), real(2013, 0)] ../source3/smbd/open.c:682(fd_open) fd_open: name symlink, flags = 0200000 mode = 00, fd = -1. Ist kein Verzeichnis [2017/06/29 09:31:38.196733, 5, pid=8504, effective(2013, 5001), real(2013, 0)] ../source3/smbd/open.c:3939(open_directory) open_directory: Could not open fd for symlink (NT_STATUS_NOT_A_DIRECTORY) [...] At the tickets are the samba-logs with loglevel 10 of the customer attached. The customer has the same snippet when trying to connect to the symlink: [...] [2017/06/29 09:44:27.215468, 5, pid=7079, effective(0, 5000), real(0, 0)] ../source3/smbd/files.c:128(file_new) allocated file structure fnum 2964904561 (7 used) [2017/06/29 09:44:27.215479, 10, pid=7079, effective(0, 5000), real(0, 0)] ../source3/smbd/files.c:756(file_name_hash) file_name_hash: /home/Administrator/symlink hash 0xd0232b8a [2017/06/29 09:44:27.215492, 10, pid=7079, effective(0, 5000), real(0, 0), class=vfs] ../source3/smbd/vfs.c:1190(check_reduced_name) check_reduced_name: check_reduced_name [symlink] [/home/Administrator] [2017/06/29 09:44:27.215505, 10, pid=7079, effective(0, 5000), real(0, 0), class=vfs] ../source3/smbd/vfs.c:1250(check_reduced_name) check_reduced_name realpath [symlink] -> [/home/Administrator/adobeTemp] [2017/06/29 09:44:27.215511, 5, pid=7079, effective(0, 5000), real(0, 0), class=vfs] ../source3/smbd/vfs.c:1337(check_reduced_name) check_reduced_name: symlink reduced to /home/Administrator/adobeTemp [2017/06/29 09:44:27.215523, 10, pid=7079, effective(0, 5000), real(0, 0)] ../source3/smbd/open.c:682(fd_open) fd_open: name symlink, flags = 0200000 mode = 00, fd = -1. Ist kein Verzeichnis [2017/06/29 09:44:27.215540, 5, pid=7079, effective(0, 5000), real(0, 0)] ../source3/smbd/open.c:3939(open_directory) open_directory: Could not open fd for symlink (NT_STATUS_NOT_A_DIRECTORY) [...]
maybe related: https://bugzilla.samba.org/show_bug.cgi?id=12721
Actually it seems to be https://bugzilla.samba.org/show_bug.cgi?id=12860 but I've applied both patches. Advisory: samba.yaml winexe and ucs-test-windows have been built as well and should be announced as unmaintained.
OK - share with links works now OK - YAML -> ls -la /var/shares/data2/ insgesamt 12 drwxr-xr-x 3 root root 4096 Jul 4 17:45 . drwxr-xr-x 3 root nogroup 4096 Jul 4 17:45 .. drwxr-xr-x 3 root root 4096 Jul 4 17:47 folder lrwxrwxrwx 1 root root 7 Jul 4 17:45 link-to-folder -> folder/ lrwxrwxrwx 1 root root 6 Jul 4 17:45 link-to-folder2 -> folder lrwxrwxrwx 1 root root 25 Jul 4 17:45 link-to-folder3 -> /var/shares/data2/folder/ -> more /etc/samba/shares.conf.d/data2 [data2] path = /var/shares/data2 ... -> testparm -s -v| grep links ... follow symlinks = Yes wide links = No i can access folder, link-to-folder, link-to-folder2 and link-to-folder3 via a win7 client
<http://errata.software-univention.de/ucs/4.2/78.html>