summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorGary Lockyer <gary@catalyst.net.nz>2018-05-21 14:31:57 +1200
committerAndrew Bartlett <abartlet@samba.org>2018-05-30 04:23:28 +0200
commitede668e8e24c86f0836dfa5740e76d8aca1e0824 (patch)
tree0a903052b7d10243984bb2dd19c81815e010ebb7 /python
parent4e2eb5660a11cea215d39495844aa76ffb5a1a2e (diff)
downloadsamba-ede668e8e24c86f0836dfa5740e76d8aca1e0824.tar.gz
samba-ede668e8e24c86f0836dfa5740e76d8aca1e0824.tar.bz2
samba-ede668e8e24c86f0836dfa5740e76d8aca1e0824.zip
dsdb partition.c: Make partition_copy_all aysnc.
partition_copy_all uses ldb_wait to wait for the update to the primary partition to complete, when updating a special dn. If a module higher up the chain inserts a callback, the code blocks in ldb_wait and does not complete. This change replaces the ldb_wait logic with a callback. Currently there is no code that triggers this bug, however the up coming audit logging changes do trigger this bug. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python')
-rw-r--r--python/samba/tests/dsdb_schema_attributes.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/python/samba/tests/dsdb_schema_attributes.py b/python/samba/tests/dsdb_schema_attributes.py
index c3b956f3b99..dbfafc4122d 100644
--- a/python/samba/tests/dsdb_schema_attributes.py
+++ b/python/samba/tests/dsdb_schema_attributes.py
@@ -242,3 +242,16 @@ systemOnly: FALSE
self.assertEquals(str(res[0].dn), "@INDEXLIST")
self.assertEquals(len(res[0]), 0)
self.assertFalse("@TEST_EXTRA" in res[0])
+
+ def test_modify_fail_of_at_indexlist(self):
+ m = {"dn": "@INDEXLIST",
+ "@TEST_NOT_EXTRA": ["1"]
+ }
+
+ msg = ldb.Message.from_dict(self.samdb, m, ldb.FLAG_MOD_DELETE)
+ try:
+ self.samdb.modify(msg)
+ self.fail("modify of @INDEXLIST with a failed constraint should fail")
+ except LdbError as err:
+ enum = err.args[0]
+ self.assertEquals(enum, ldb.ERR_NO_SUCH_ATTRIBUTE)