Bug 44891 - samba does not follow symlinks
samba does not follow symlinks
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Samba4
UCS 4.2
Other Linux
: P5 normal (vote)
: UCS 4.2-1-errata
Assigned To: Arvid Requate
Felix Botner
https://bugzilla.samba.org/show_bug.c...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-06-29 11:25 CEST by Jens Thorp-Hansen
Modified: 2017-07-05 13:06 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.137
Enterprise Customer affected?: Yes
School Customer affected?: Yes
ISV affected?:
Ticket number: 2017062821000956
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Thorp-Hansen univentionstaff 2017-06-29 11:25:17 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)
[...]
Comment 1 Jens Thorp-Hansen univentionstaff 2017-06-29 11:27:36 CEST
maybe related: https://bugzilla.samba.org/show_bug.cgi?id=12721
Comment 2 Arvid Requate univentionstaff 2017-07-03 13:59:30 CEST
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.
Comment 3 Felix Botner univentionstaff 2017-07-04 17:54:26 CEST
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
Comment 4 Janek Walkenhorst univentionstaff 2017-07-05 13:06:41 CEST
<http://errata.software-univention.de/ucs/4.2/78.html>