[PATCH] Fix bug 13465

Christof Schmitt cs at samba.org
Thu Jul 26 22:43:26 UTC 2018


On Thu, Jul 12, 2018 at 04:42:44PM -0700, Christof Schmitt wrote:
> On Thu, Jul 12, 2018 at 10:10:36AM +0200, Ralph Böhme wrote:
> > On Wed, Jul 11, 2018 at 02:52:14PM -0700, Christof Schmitt wrote:
> > >It also works on my cluster.
> > 
> > Thanks for testing! Which combinations did you test? As I've learnt in this
> 
> I tested the basic commands as root. You are correct, we need more
> extensive testing. This also goes back to the old discussion that we
> need a clustered Samba environment in autobuild...
> 
> > excersize, we should test all possible combinations, as most things are not
> > covered by autobuild:
> > 
> > Cluster (with include=registry):
> > - all commands as root
> 
> These commands still failed for me as root:
> 
> eventlogadm -o write test
> PANIC: messaging not initialized
> 
> ntlm_auth --diagnostics
> PANIC: messaging not initialized
> 
> smbcontrol winbindd debuglevel
> PANIC: messaging not initialized
> 
> > - all commands as user
> 
> Most fail when run as a user:

I looked through the code and initializing messaging requires root
permissions. I also went back to a clustered Samba 4.6 build and running
commands as a user is not possible:

$ sharesec --view-all
directory_create_or_exist: lstat failed on directory /var/lib/samba/private/msg.sock: Permission denied
messaging_init failed
db_open: No ctdb connection
directory_create_or_exist: lstat failed on directory /var/lib/samba/private/msg.sock: Permission denied
messaging_init failed
db_open: No ctdb connection
regdb_init: Failed to open registry /var/lib/samba/registry.tdb (Input/output error)
Failed to initialize the registry: WERR_IO_DEVICE
error initializing registry configuration: SBC_ERR_BADFILE

$ smbclient
directory_create_or_exist: lstat failed on directory /var/lib/samba/private/msg.sock: Permission denied
messaging_init failed
db_open: No ctdb connection
directory_create_or_exist: lstat failed on directory /var/lib/samba/private/msg.sock: Permission denied
messaging_init failed
db_open: No ctdb connection
regdb_init: Failed to open registry /var/lib/samba/registry.tdb (Input/output error)
Failed to initialize the registry: WERR_IO_DEVICE
error initializing registry configuration: SBC_ERR_BADFILE
/usr/bin/smbclient: Can't load /etc/samba/smb.conf - run testparm to debug it

$ net
messaging_init failed
messaging_init failed
Failed to initialize the registry: WERR_IO_DEVICE
Can't load /etc/samba/smb.conf - run testparm to debug it

Based on this, a sensible approach would be to present a proper error when
trying to run as user on a clustered Samba build while ensuring that everything
works as root. We also have to ensure that non-clustered builds still allow to
run the commands as normal user.

Christof



More information about the samba-technical mailing list