ldb_tdb: Do not make search or DB modifications without a lock
authorGary Lockyer <gary@catalyst.net.nz>
Thu, 22 Mar 2018 22:27:10 +0000 (11:27 +1300)
committerStefan Metzmacher <metze@samba.org>
Thu, 12 Apr 2018 13:05:41 +0000 (15:05 +0200)
commit66282786ebfa5cb45f14f374c95a2fd697df4b44
treedd11d0a4c1dc786175427cdc3219111abd75bcf7
parent77dddd7749afd00aeae273504fb61701275dcb46
ldb_tdb: Do not make search or DB modifications without a lock

The ldb_cache startup code would previously not take a read lock
nor a sufficiently wide write transaction.

The new code takes a read lock, and if it needs to write takes a
write lock (transaction) and re-reads before continuing.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/ldb_tdb/ldb_cache.c