summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorGarming Sam <garming@catalyst.net.nz>2017-11-22 12:46:31 +1300
committerAndrew Bartlett <abartlet@samba.org>2017-11-24 01:13:14 +0100
commit8eb95bc1d1ef3d9f6eb41d628b8fb0c8f98cc3c6 (patch)
tree311183f5768c1e28cfe83bbbd53b2ed6d7b0aa74 /source4/dsdb
parent17f1c6f9f4c6d14c69d0d7030fcd919fbc0f6231 (diff)
downloadsamba-8eb95bc1d1ef3d9f6eb41d628b8fb0c8f98cc3c6.tar.gz
schema_set: Add comment about set schema from ldif in a transaction
This is normally called with a transaction or before access is shared. The python code and some tests may also cause an issue, but as these are fixed at runtime, this is only a temporary issue that resolves itself. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/schema/schema_set.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c
index 32cdd7192d6..226e31e4019 100644
--- a/source4/dsdb/schema/schema_set.c
+++ b/source4/dsdb/schema/schema_set.c
@@ -892,6 +892,9 @@ WERROR dsdb_schema_set_el_from_ldb_msg(struct ldb_context *ldb,
* Rather than read a schema from the LDB itself, read it from an ldif
* file. This allows schema to be loaded and used while adding the
* schema itself to the directory.
+ *
+ * Should be called with a transaction (or failing that, have no concurrent
+ * access while called).
*/
WERROR dsdb_set_schema_from_ldif(struct ldb_context *ldb,
@@ -977,6 +980,13 @@ WERROR dsdb_set_schema_from_ldif(struct ldb_context *ldb,
}
}
+ /*
+ * TODO We may need a transaction here, otherwise this causes races.
+ *
+ * To do so may require an ldb_in_transaction function. In the
+ * meantime, assume that this is always called with a transaction or in
+ * isolation.
+ */
ret = dsdb_set_schema(ldb, schema, SCHEMA_WRITE);
if (ret != LDB_SUCCESS) {
status = WERR_FOOBAR;