]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
domain_update: remove useless searches to '(objectClass=samDomain)'
authorStefan Metzmacher <metze@samba.org>
Mon, 13 Mar 2023 11:05:24 +0000 (12:05 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 22 Mar 2023 22:10:32 +0000 (22:10 +0000)
samDomain is an auxiliary class of domainDNS, so we'll handle them
in the search for domainDNS anyway. In addition searches for auxiliary
classes will never be found in searches.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/domain_update.py

index 3fca10d5cccd4f92d9aff0f261248369db1e1312..7fb465cef653dc4664280fcc692c6ed3d01bac78 100644 (file)
@@ -298,16 +298,6 @@ objectClass: msTPM-InformationObjectsContainer
 
         ace = "(OA;CIIO;WP;ea1b7b93-5e48-46d5-bc6c-4df4fda78a35;bf967a86-0de6-11d0-a285-00aa003049e2;PS)"
 
-        res = self.samdb.search(expression="(objectClass=samDomain)",
-                                attrs=["nTSecurityDescriptor"],
-                                controls=["search_options:1:2"])
-        for msg in res:
-            existing_sd = ndr_unpack(security.descriptor,
-                                     msg["nTSecurityDescriptor"][0])
-            existing_sddl = existing_sd.as_sddl(self.domain_sid)
-
-            self.insert_ace_into_dacl(msg.dn, existing_sddl, ace)
-
         res = self.samdb.search(expression="(objectClass=domainDNS)",
                                 attrs=["nTSecurityDescriptor"],
                                 controls=["search_options:1:2"])
@@ -354,16 +344,6 @@ objectClass: msTPM-InformationObjectsContainer
 
         ace = "(OA;CIOI;RPWP;3f78c3e5-f79a-46bd-a0b8-9d18116ddc79;;PS)"
 
-        res = self.samdb.search(expression="(objectClass=samDomain)",
-                                attrs=["nTSecurityDescriptor"],
-                                controls=["search_options:1:2"])
-        for msg in res:
-            existing_sd = ndr_unpack(security.descriptor,
-                                     msg["nTSecurityDescriptor"][0])
-            existing_sddl = existing_sd.as_sddl(self.domain_sid)
-
-            self.insert_ace_into_dacl(msg.dn, existing_sddl, ace)
-
         res = self.samdb.search(expression="(objectClass=domainDNS)",
                                 attrs=["nTSecurityDescriptor"],
                                 controls=["search_options:1:2"])