auth3: Simplify get_system_info3
authorVolker Lendecke <vl@samba.org>
Mon, 13 Feb 2017 20:33:57 +0000 (21:33 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 27 Feb 2017 10:31:53 +0000 (11:31 +0100)
We have global_sid_System, so we don't need to dom_sid_parse("S-1-5-18");

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Feb 27 11:31:53 CET 2017 on sn-devel-144

source3/auth/auth_util.c

index 3c1ae6441ca28ae07a8850cfaf75fe7fff5c5d59..5d9f0e0270fefa51ece72b9d3a41ed350fd2ff56 100644 (file)
@@ -718,7 +718,6 @@ static NTSTATUS get_system_info3(TALLOC_CTX *mem_ctx,
                                 struct netr_SamInfo3 *info3)
 {
        NTSTATUS status;
-       struct dom_sid *system_sid;
 
        /* Set account name */
        init_lsa_String(&info3->base.account_name, "SYSTEM");
@@ -727,17 +726,9 @@ static NTSTATUS get_system_info3(TALLOC_CTX *mem_ctx,
        init_lsa_StringLarge(&info3->base.logon_domain, "NT AUTHORITY");
 
 
-       /* The SID set here will be overwirtten anyway, but try and make it SID_NT_SYSTEM anyway */
-       /* Domain sid is NT_AUTHORITY */
-
-       system_sid = dom_sid_parse_talloc(mem_ctx, SID_NT_SYSTEM);
-       if (system_sid == NULL) {
-               return NT_STATUS_NO_MEMORY;
-       }
-
-       status = dom_sid_split_rid(mem_ctx, system_sid, &info3->base.domain_sid, 
+       status = dom_sid_split_rid(mem_ctx, &global_sid_System,
+                                  &info3->base.domain_sid,
                                   &info3->base.rid);
-       TALLOC_FREE(system_sid);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }