diff options
author | Garming Sam <garming@catalyst.net.nz> | 2017-11-22 12:34:01 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2017-11-24 01:13:14 +0100 |
commit | 17f1c6f9f4c6d14c69d0d7030fcd919fbc0f6231 (patch) | |
tree | 5b57e63ba795358f2911835bbcde9d456dbdf9f8 /source4/libnet | |
parent | 84a7baeef30a41d51eff8e6486ed67ed3318b115 (diff) | |
download | samba-17f1c6f9f4c6d14c69d0d7030fcd919fbc0f6231.tar.gz |
schema: Make writing indices flag an enum for a new state
In schema_load_init, we find that the writing of indices is not locked
in any way. This leads to race conditions. To resolve this, we need to
have a new state (SCHEMA_COMPARE) which can report to the caller that we
need to open a transaction to write the indices.
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/libnet')
-rw-r--r-- | source4/libnet/libnet_vampire.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c index a449e1c86ef..2871a683b74 100644 --- a/source4/libnet/libnet_vampire.c +++ b/source4/libnet/libnet_vampire.c @@ -331,7 +331,7 @@ static WERROR libnet_vampire_cb_apply_schema(struct libnet_vampire_cb_state *s, provision_schema = dsdb_get_schema(s->ldb, s); } else { provision_schema = dsdb_get_schema(schema_ldb, s); - ret = dsdb_reference_schema(s->ldb, provision_schema, false); + ret = dsdb_reference_schema(s->ldb, provision_schema, SCHEMA_MEMORY_ONLY); if (ret != LDB_SUCCESS) { DEBUG(0,("Failed to attach schema from local provision using remote prefixMap.")); return WERR_INTERNAL_ERROR; @@ -368,7 +368,7 @@ static WERROR libnet_vampire_cb_apply_schema(struct libnet_vampire_cb_state *s, * attach the schema we just brought over DRS to the ldb, * so we can use it in dsdb_convert_object_ex below */ - ret = dsdb_set_schema(s->ldb, s->self_made_schema, true); + ret = dsdb_set_schema(s->ldb, s->self_made_schema, SCHEMA_WRITE); if (ret != LDB_SUCCESS) { DEBUG(0,("Failed to attach working schema from DRS.\n")); return WERR_INTERNAL_ERROR; |