Merge ~sergiodj/ubuntu/+source/samba:samba-v1-file-as-directory-bug1872476-v2 into ubuntu/+source/samba:ubuntu/focal-devel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Rafael David Tinoco | ||||
Approved revision: | 2f4206c0fae5109c07f1b86ce05a8c3b5e9c4243 | ||||
Merged at revision: | 2f4206c0fae5109c07f1b86ce05a8c3b5e9c4243 | ||||
Proposed branch: | ~sergiodj/ubuntu/+source/samba:samba-v1-file-as-directory-bug1872476-v2 | ||||
Merge into: | ubuntu/+source/samba:ubuntu/focal-devel | ||||
Diff against target: |
120 lines (+98/-0) 3 files modified
debian/changelog (+9/-0) debian/patches/0023-libsmb-Don-t-try-to-find-posix-stat-info-in-SMBC_get.patch (+88/-0) debian/patches/series (+1/-0) |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Rafael David Tinoco (community) | Approve | ||
Canonical Server | Pending | ||
Canonical Server Core Reviewers | Pending | ||
Review via email: mp+383358@code.staging.launchpad.net |
Description of the change
The current samba package on focal suffers from a bug that manifests itselft when the SMB1 (NT1) protocol is being used. In this scenario, the user will see regular files being presented as directories when using GIO/gvfs to browse the share (e.g., nautilus, or via the "gio" command). Even though the SMB1 protocol is old, it is still used by some old NAS devices and therefore this issue can impact a non-trivial amount of users.
The fix, which had to be cherry-picked from upstream, is to revert a specific libsmb code that attempts to obtain some POSIX stat(2) information when running on UNIX-like environments. The upstream commit can be found here:
https:/
In order to reproduce the bug, one can do:
$ lxc launch ubuntu-daily:focal samba-bug1872476
$ lxc shell samba-bug1872476
# apt install samba smbclient gvfs gvfs-backends dbus-x11
# sed -i 's/^\[global\
# cat >> /etc/samba/smb.conf << __EOF__
[testshare]
path = /testshare
readonly = no
browsable = yes
guest ok = yes
__EOF__
# mkdir /testshare
# cat > /testshare/123.txt << __EOF__
Hi, this is a test for samba bug 1872476.
This is a regular file, and not a directory.
__EOF__
# ufw allow samba
# eval $(dbus-launch --sh-syntax)
# gio mount -a smb://127.
# gio info smb://127.
type: directory
As can be seen above, the regular file '123.txt' is mistakenly listed as a directory.
There's a PPA with a proposed fix here:
https:/
When trying it out, it is important to umount the share and remount it with the new package:
# gio mount -u smb://127.
# add-apt-repository ppa:sergiodj/samba-bug1872476-v2
# apt update && apt upgrade
# gio mount -a smb://127.
# gio info smb://127.
type: regular
autopkg is still happy:
autopkgtest [14:38:14]: test smbclient-
autopkgtest [14:38:14]: test smbclient-
smbclient-
autopkgtest [14:38:15]: @@@@@@@
cifs-share-access PASS
python-smoke PASS
smbclient-
smbclient-
smbclient-
There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.
I'll review this one.