1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-20 22:50:26 +03:00

s3:auth: move add_local_groups() out of finalize_local_nt_token()

finalize_local_nt_token() will be used in another place,
were we don't want to add local groups in a following commit.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13328

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit df3d278853ec097df27c221369dfb3ed0297d6c8)
This commit is contained in:
Stefan Metzmacher 2018-03-06 17:14:34 +01:00
parent 88c8499ccc
commit 253f0d1841

View File

@ -208,6 +208,8 @@ static NTSTATUS add_builtin_administrators(struct security_token *token,
return NT_STATUS_OK;
}
static NTSTATUS add_local_groups(struct security_token *result,
bool is_guest);
static NTSTATUS finalize_local_nt_token(struct security_token *result,
bool is_guest);
@ -323,6 +325,13 @@ NTSTATUS create_local_nt_token_from_info3(TALLOC_CTX *mem_ctx,
}
}
status = add_local_groups(usrtok, is_guest);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(3, ("Failed to add local groups\n"));
TALLOC_FREE(usrtok);
return status;
}
status = finalize_local_nt_token(usrtok, is_guest);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(3, ("Failed to finalize nt token\n"));
@ -392,6 +401,12 @@ struct security_token *create_local_nt_token(TALLOC_CTX *mem_ctx,
}
}
status = add_local_groups(result, is_guest);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(result);
return NULL;
}
status = finalize_local_nt_token(result, is_guest);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(result);
@ -502,13 +517,6 @@ static NTSTATUS finalize_local_nt_token(struct security_token *result,
NTSTATUS status;
struct acct_info *info;
/* Add any local groups. */
status = add_local_groups(result, is_guest);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
/* Add in BUILTIN sids */
status = add_sid_to_array(result, &global_sid_World,