diff options
author | Andrew Bartlett <abartlet@samba.org> | 2023-03-03 16:49:00 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2023-04-05 02:10:35 +0000 |
commit | f6e93e2b3d9b7e351f622a2275746474196ec2fa (patch) | |
tree | f60e40ce13d10dbbaa9e773c483ae22dea4f8de4 /lib/ldb-samba | |
parent | f188b6a978f6741352df018059fcf1c758a58027 (diff) | |
download | samba-f6e93e2b3d9b7e351f622a2275746474196ec2fa.tar.gz |
CVE-2023-0614 dsdb: Add pre-cleanup and self.addCleanup() of OU created in match_rules tests
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15270
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Diffstat (limited to 'lib/ldb-samba')
-rwxr-xr-x | lib/ldb-samba/tests/match_rules.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/ldb-samba/tests/match_rules.py b/lib/ldb-samba/tests/match_rules.py index abf485c9eab..2af1dd6a070 100755 --- a/lib/ldb-samba/tests/match_rules.py +++ b/lib/ldb-samba/tests/match_rules.py @@ -31,11 +31,19 @@ class MatchRulesTests(samba.tests.TestCase): self.ou_groups = "OU=groups,%s" % self.ou self.ou_computers = "OU=computers,%s" % self.ou + try: + self.ldb.delete(self.ou, ["tree_delete:1"]) + except LdbError as e: + pass + # Add a organizational unit to create objects self.ldb.add({ "dn": self.ou, "objectclass": "organizationalUnit"}) + self.addCleanup(self.ldb.delete, self.ou, controls=['tree_delete:0']) + + # Add the following OU hierarchy and set otherWellKnownObjects, # which has BinaryDN syntax: # |