diff options
author | Andrew Bartlett <abartlet@samba.org> | 2023-03-03 16:49:00 +1300 |
---|---|---|
committer | Jule Anger <janger@samba.org> | 2023-03-20 10:03:38 +0100 |
commit | 979997992a436cd32d1818e1c6c94faeedfe2b9f (patch) | |
tree | 12fddaf9a068f5807c1629d91bfa764e681fe44b | |
parent | c64b48b2b2652d6a8241105d570904219a98d226 (diff) | |
download | samba-979997992a436cd32d1818e1c6c94faeedfe2b9f.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>
-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: # |