]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4-rpc_server/lsa: Use samdb_system_container_dn() in dcesrv_lsa_get_policy_state()
authorAndrew Bartlett <abartlet@samba.org>
Thu, 27 Jul 2023 04:58:13 +0000 (16:58 +1200)
committerJule Anger <janger@samba.org>
Tue, 1 Aug 2023 09:53:12 +0000 (09:53 +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>
(cherry picked from commit 4e18066fa243da1c505f782ba87187c3bb1078ee)

source4/rpc_server/lsa/lsa_init.c

index 62aa638f4f56be9f2b24f827c73be985b8a9288f..1065cc33f4da4f2e1c31f709e9f9c5290879619d 100644 (file)
@@ -146,15 +146,11 @@ NTSTATUS dcesrv_lsa_get_policy_state(struct dcesrv_call_state *dce_call,
 
        /* work out the system_dn - useful for so many calls its worth
           fetching here */
-       state->system_dn = ldb_dn_copy(state, state->domain_dn);
+       state->system_dn = samdb_system_container_dn(state->sam_ldb, state);
        if (state->system_dn == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
 
-       if (!ldb_dn_add_child_fmt(state->system_dn, "CN=System")) {
-               return NT_STATUS_NO_MEMORY;
-       }
-
        state->builtin_sid = dom_sid_parse_talloc(state, SID_BUILTIN);
        if (!state->builtin_sid) {
                return NT_STATUS_NO_SUCH_DOMAIN;