smbc_opendir returns EEXIST if login credentials are incorrect, breaking SMB shares in Kodi
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
samba (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
High
|
Karl Stenerud |
Bug Description
[Impact]
A regression in Samba causes the wrong error message to be returned on an unsuccessful login, returning EEXIST instead of EACCESS or EPERM.
[Tese Case]
# lxc launch ubuntu:bionic tester && lxc exec tester bash
# apt update && apt dist-upgrade -y && apt install -y samba gvfs libglib2.0-bin gvfs-bin gvfs-backends dbus-x11 &&
echo "
[global]
workgroup = WORKGROUP
security = user
map to guest = bad user
[test]
path = /tmp
browseable = yes
read only = yes
valid users = someone
" >/etc/samba/
service smbd restart
# su - -c "dbus-launch gio mount -a smb://localhost
gio: smb://localhost
[Regression Potential]
The change reverts a regression in the closing order in certain cases from a previous version of samba, and should not cause further regressions in the fix.
[Original Description]
Target to milestone
Bionic Remove
Triaged
High
Karl Stenerud
Target to milestone
Also affects project (?) Also affects distribution/
Edit
Bug Description
In Kodi, try to add a smb:// URL for a share that doesn't allow guest logins and you'll get a cryptic "File Exists" error. It never asks for login credentials. From online searching, this is most likely due to a bug in libsmbclient where smbc_opendir will return EEXIST instead of a more appropriate error code if invalid login credentials were provided.
This was fixed in Samba 4.8:
https:/
But 18.04 is shipping 4.7.
Trying to add a share where the hostname doesn't resolve results in some cryptic messages as well, but that may or may not be a different bug.
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: libsmbclient 2:4.7.6+
ProcVersionSign
Uname: Linux 4.15.0-38-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.9-0ubuntu7.4
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Thu Nov 1 21:15:29 2018
InstallationDate: Installed on 2018-09-12 (51 days ago)
InstallationMedia: Ubuntu 18.04.1 LTS "Bionic Beaver" - Release amd64 (20180725)
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
RelatedPackageV
nautilus 1:3.26.
gvfs 1.36.1-0ubuntu1.1
SambaClientRegr
SourcePackage: samba
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
- Andreas Hasenack: Approve
- Canonical Server: Pending requested
-
Diff: 62 lines (+40/-0)3 files modifieddebian/changelog (+7/-0)
debian/patches/auth-fail-eexist.diff (+32/-0)
debian/patches/series (+1/-0)
Changed in samba (Ubuntu Bionic): | |
assignee: | nobody → Karl Stenerud (kstenerud) |
description: | updated |
description: | updated |
Found a workaround: Enter the username and password as part of the URL when adding the source. That is:
smb://< username> :<password> @<host> /<folder> /
This isn't really acceptable, as it means the password is plainly visible onscreen as you're setting up the share.