dsdb: ensure we take out a read lock during the dsdb_init
authorAndrew Bartlett <abartlet@samba.org>
Mon, 9 Apr 2018 06:13:59 +0000 (18:13 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 12 Apr 2018 03:15:17 +0000 (05:15 +0200)
commit887b48c49328f7cede260923a33633096402a763
tree742920a8e6ead5fa1d8516dbc4fdbc1f2146e752
parente9483c269a9ef9e585030ec5f0337f88e73d0863
dsdb: ensure we take out a read lock during the dsdb_init

We have to also take it out in the partitions code when we load the
partition backends.

This ensures that the init handlers hold a whole-db lock just as the
search code does.

To ensure the locking count in schema_load is balanced, the
private data is now created in the first lock_read() call.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13379

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source4/dsdb/samdb/ldb_modules/partition.c
source4/dsdb/samdb/ldb_modules/partition_init.c
source4/dsdb/samdb/ldb_modules/samba_dsdb.c
source4/dsdb/samdb/ldb_modules/schema_load.c