summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2019-11-02 14:01:10 +0100
committerJeremy Allison <jra@samba.org>2019-11-06 20:36:34 +0000
commit995de9c2d2e95a782b81c215efc8d4ab4b3d54b9 (patch)
tree25fbc3f50cecf1727eb7125adf638ba3147c4e07
parent8ec9e97666653469e5bd56ef0576fb0af1406a82 (diff)
downloadsamba-995de9c2d2e95a782b81c215efc8d4ab4b3d54b9.tar.gz
ntlm_auth: Simplify session generation
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>
-rw-r--r--source3/utils/ntlm_auth.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/source3/utils/ntlm_auth.c b/source3/utils/ntlm_auth.c
index 85862e389e8..c9d2e44adb4 100644
--- a/source3/utils/ntlm_auth.c
+++ b/source3/utils/ntlm_auth.c
@@ -731,7 +731,6 @@ static NTSTATUS ntlm_auth_generate_session_info(struct auth4_context *auth_conte
struct auth_session_info **session_info_out)
{
const char *unix_username = (const char *)server_returned_info;
- bool ok;
struct dom_sid *sids = NULL;
struct auth_session_info *session_info = NULL;
@@ -764,21 +763,9 @@ static NTSTATUS ntlm_auth_generate_session_info(struct auth4_context *auth_conte
TALLOC_FREE(session_info);
return NT_STATUS_NO_MEMORY;
}
- ok = dom_sid_parse(SID_WORLD, &sids[0]);
- if (!ok) {
- TALLOC_FREE(session_info);
- return NT_STATUS_INTERNAL_ERROR;
- }
- ok = dom_sid_parse(SID_NT_NETWORK, &sids[1]);
- if (!ok) {
- TALLOC_FREE(session_info);
- return NT_STATUS_INTERNAL_ERROR;
- }
- ok = dom_sid_parse(SID_NT_AUTHENTICATED_USERS, &sids[2]);
- if (!ok) {
- TALLOC_FREE(session_info);
- return NT_STATUS_INTERNAL_ERROR;
- }
+ sid_copy(&sids[0], &global_sid_World);
+ sid_copy(&sids[1], &global_sid_Network);
+ sid_copy(&sids[2], &global_sid_Authenticated_Users);
session_info->security_token->num_sids = talloc_array_length(sids);
session_info->security_token->sids = sids;