1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-03 01:18:10 +03:00

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>
This commit is contained in:
Andrew Bartlett 2023-03-03 16:49:00 +13:00 committed by Jule Anger
parent c64b48b2b2
commit 979997992a

View File

@ -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:
#