]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
auth: Simplify session generation
authorVolker Lendecke <vl@samba.org>
Sat, 2 Nov 2019 12:56:49 +0000 (13:56 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 6 Nov 2019 20:36:34 +0000 (20:36 +0000)
We don't need to parse a text sid, we have those as binary available

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source4/auth/session.c

index 71d236aa3e19bf3bc532e3679a5f7956474718f0..c5fc226a7d731d31333352b1f758e8b7cfbfbdca 100644 (file)
@@ -135,16 +135,10 @@ _PUBLIC_ NTSTATUS auth_generate_session_info(TALLOC_CTX *mem_ctx,
                        return NT_STATUS_NO_MEMORY;
                }
 
-               if (!dom_sid_parse(SID_WORLD, &sids[num_sids])) {
-                       TALLOC_FREE(tmp_ctx);
-                       return NT_STATUS_INTERNAL_ERROR;
-               }
+               sid_copy(&sids[num_sids], &global_sid_World);
                num_sids++;
 
-               if (!dom_sid_parse(SID_NT_NETWORK, &sids[num_sids])) {
-                       TALLOC_FREE(tmp_ctx);
-                       return NT_STATUS_INTERNAL_ERROR;
-               }
+               sid_copy(&sids[num_sids], &global_sid_Network);
                num_sids++;
        }
 
@@ -155,10 +149,7 @@ _PUBLIC_ NTSTATUS auth_generate_session_info(TALLOC_CTX *mem_ctx,
                        return NT_STATUS_NO_MEMORY;
                }
 
-               if (!dom_sid_parse(SID_NT_AUTHENTICATED_USERS, &sids[num_sids])) {
-                       TALLOC_FREE(tmp_ctx);
-                       return NT_STATUS_INTERNAL_ERROR;
-               }
+               sid_copy(&sids[num_sids], &global_sid_Authenticated_Users);
                num_sids++;
        }