The Samba-Bugzilla – Bug 10781
smbstatus: locking.tdb - TDB_MUTEX_LOCKING requires TDB_CLEAR_IF_FIRST
Last modified: 2014-12-04 08:09:23 UTC
smbstatus gives the following, when using dbwrap_tdb_mutexes:* = yes
tdb(/usr/local/samba/var/lock/locking.tdb): tdb_open_ex: invalid flags for /usr/local/samba/var/lock/locking.tdb - TDB_MUTEX_LOCKING requires TDB_CLEAR_IF_FIRST
/usr/local/samba/var/lock/locking.tdb not initialised
This is normal if an SMB client has never connected to your server.
TDB_MUTEX_LOCKING doesn't work together with O_RDONLY as that
clears the TDB_CLEAR_IF_FIRST flag.
The problem is located in source3/utils/status.c
db = db_open(NULL, lock_path("locking.tdb"), 0,
TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, O_RDONLY, 0,
And in locking_init_readonly() => locking_init_internal()
A possible fix would be to skip TDB_MUTEX_LOCKING, when using
O_RDONLY, as O_RDONLY also implies TDB_NOLOCK, which allows
a tdb created with mutexes to be read.
Is this a showstopper for 4.2.0?
This is fixed in master, I'll propose the backport shortly.
The test for this is breaking for me on Debian unstable:
.......TDB_MUTEX_LOCKING with O_RDONLY should fail with EINVAL - 22/0
apparently this is because the return value is non-NULL
fixed in tdb-1.3.3