From: Andrew Bartlett Date: Thu, 27 Jul 2023 05:00:21 +0000 (+1200) Subject: s4-rpc_server/netlogon: Use samdb_system_container_dn() in fill_trusted_domains_array() X-Git-Tag: samba-4.17.11~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d6bc07a57252ea380e13df84bcb50e8ae23b3c9;p=thirdparty%2Fsamba.git s4-rpc_server/netlogon: Use samdb_system_container_dn() in fill_trusted_domains_array() This is now exactly the same actions, but just uses common code to do it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=9959 Signed-off-by: Andrew Bartlett Reviewed-by: Stefan Metzmacher (cherry picked from commit a900f6aa5d909d912ee3ca529baa4047c9c4da87) --- diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c index 0a5fbaef58b..3f312f1549f 100644 --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c @@ -3911,15 +3911,11 @@ static WERROR fill_trusted_domains_array(TALLOC_CTX *mem_ctx, return WERR_INVALID_FLAGS; } - system_dn = ldb_dn_copy(mem_ctx, ldb_get_default_basedn(sam_ctx)); + system_dn = samdb_system_container_dn(sam_ctx, mem_ctx); if (system_dn == NULL) { return WERR_NOT_ENOUGH_MEMORY; } - if (!ldb_dn_add_child_fmt(system_dn, "CN=System")) { - return WERR_NOT_ENOUGH_MEMORY; - } - ret = gendb_search(sam_ctx, mem_ctx, system_dn, &dom_res, trust_attrs, "(objectclass=trustedDomain)");