From: Stefan Metzmacher Date: Mon, 13 Mar 2023 11:05:24 +0000 (+0100) Subject: domain_update: remove useless searches to '(objectClass=samDomain)' X-Git-Tag: talloc-2.4.1~1326 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a3dac8efe4b6c5b55c3dfde7ee40e45706455058;p=thirdparty%2Fsamba.git domain_update: remove useless searches to '(objectClass=samDomain)' 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 Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/domain_update.py b/python/samba/domain_update.py index 3fca10d5ccc..7fb465cef65 100644 --- a/python/samba/domain_update.py +++ b/python/samba/domain_update.py @@ -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"])