Bug 1661959

Summary: smbclient mkdir failed on directory /var/lib/samba/lock/msg.lock
Product: [Fedora] Fedora Reporter: Paul DeStefano <prd-fedora>
Component: sambaAssignee: Guenther Deschner <gdeschner>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 31CC: abokovoy, anoopcs, asn, brent.kimberley, chris.rees, david, ed, gdeschner, jarrpa, kc8hfi, lmohanty, madam, ryan.brothers, sbose, spacewar, ssorce, th.neuber
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1781231 (view as bug list) Environment:
Last Closed: 2020-03-17 14:50:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1781231, 1781232    

Description Paul DeStefano 2018-12-24 22:12:08 UTC
Description of problem:
When I use smbclient to connect to a share, I get the error:

mkdir failed on directory /var/lib/samba/lock/msg.lock: Permission denied
Unable to initialize messaging context

Version-Release number of selected component (if applicable):
samba-client-4.9.3-0.fc29.x86_64

How reproducible:
Well, I guess I haven't run smbclient in a while, but it seems to happen all the time, now.  I'm sure this didn't happen the last time I use smbclient.

Comment 1 kc8hfi 2019-03-05 15:36:12 UTC
I can confirm this is happening on my fedora 29 system.
I've got this version of samba:

samba-client-4.9.4-1.fc29.x86_64


This is also happening on my fedora 28 system when I try to connect to a share.  
samba-client-4.8.8-0.fc28.x86_64



I went to a fedora 27 system and this problem doesn't occur.  
samba-client-4.7.10-1.fc27.x86_64

How reproducible:
It happens every single time you smbclient to connect to a share on f28 and f29

Comment 2 Andreas Schneider 2019-03-06 14:01:54 UTC
With 4.9.4 the message should be gone or different unless you have set a 'log level' in the config file.

Comment 3 Guenther Deschner 2019-03-06 14:35:47 UTC
Hm, I don't think so, as the toplevel directory (/var/lib/samba/lock/msg.lock) non-root creation attempt fails with a debug 0 statement.

Comment 4 Andreas Schneider 2019-03-15 17:06:05 UTC
Will be fixed with an update to a newer Samba version.

Comment 5 Eric Smith 2019-06-03 05:11:35 UTC
This still happens with samba-client-4.10.4-1.fc30.x86_64.

Comment 6 Paul DeStefano 2019-06-07 21:49:44 UTC
Cool, thanks for the update, Andreas.

Comment 7 3BK 2019-08-13 14:53:03 UTC
Issue observed on samba-client-4.9.1-6.<distro>.x86_64 as well.

Comment 8 3BK 2019-08-13 16:47:47 UTC
When running as non-root, do any of the following artifacts need to be replicated and restricted?

$ man smb.conf | grep "/var/lib/samba"
           Default: binddns dir = /var/lib/samba/bind-dns
           Default: cache directory = /var/lib/samba
           Default: lock directory = /var/lib/samba/lock
           Default: ntp signd socket directory = /var/lib/samba/ntp_signd
           Default: private dir = /var/lib/samba/private
           Default: state directory = /var/lib/samba
           Default: smb passwd file = /var/lib/samba/private/smbpasswd

Comment 9 Ed van Gasteren 2019-11-10 09:26:22 UTC
It happend to me also just now on Fedora 31 with samba-client-4.11.0-3.fc31.x86_64.

My work around is:

# smbclient -L <some server>

Doing that as root creates a /var/lib/samba/lock/msg.lock after which the error message goes away.

Comment 10 Paul DeStefano 2019-11-11 04:26:32 UTC
Update to F31.  I still see this, too.

Ed's work around is interesting.  It produces some other files, too, which I'm not sure should be left lying around.  I don't get what these other files are for.  gencache.tdb is world readable.

Comment 11 David Hansen 2019-11-12 02:23:24 UTC
Seems like the group for files/directories under /var/lib/samba/ should perhaps be something like samba into which any authorized users could be added and thus be able to create/access files under /var/lib/samba/lock or /var/lib/samba/private.   doing this manually eliminates this error message and allows msg.sock & msg.lock to be created (though they are created as the user running smbclient - which would then likely cause problems for another user).  Not sure why smbclient is creating these files that are typically needed for the server.  Probably just cause it's calling some common initialization library function that does that.   Doesn't really seem like the right thing to do for a client-only application.

Comment 12 chris.rees 2020-03-16 15:30:02 UTC
Is there still no official fix for this ?

Comment 13 Andreas Schneider 2020-03-17 14:50:25 UTC
Should be available in a few ours, see:

https://bodhi.fedoraproject.org/updates/FEDORA-2020-5c3c93a400