s4-rpc_server/netlogon: Use samdb_system_container_dn() in fill_trusted_domains_array()
authorAndrew Bartlett <abartlet@samba.org>
Thu, 27 Jul 2023 05:00:21 +0000 (17:00 +1200)
committerStefan Metzmacher <metze@samba.org>
Mon, 31 Jul 2023 06:18:33 +0000 (06:18 +0000)
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 <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/rpc_server/netlogon/dcerpc_netlogon.c

index bb1a08be9db6d2b1159e6f038cc6594229eeda2a..0b07641f40937e46b1bb3496f535d07a951051fd 100644 (file)
@@ -3941,15 +3941,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)");