diff options
author | Stefan Metzmacher <metze@samba.org> | 2018-03-06 17:14:34 +0100 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2018-03-15 21:54:16 +0100 |
commit | df3d278853ec097df27c221369dfb3ed0297d6c8 (patch) | |
tree | e7e10c7ab8572e69b0dc96aa6d33292ac3ee089b /source3/auth/token_util.c | |
parent | f3ca3e71cc35876df47e31ec9c3643308add2405 (diff) | |
download | samba-df3d278853ec097df27c221369dfb3ed0297d6c8.tar.gz |
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>
Diffstat (limited to 'source3/auth/token_util.c')
-rw-r--r-- | source3/auth/token_util.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/source3/auth/token_util.c b/source3/auth/token_util.c index 03c4b646007..e5a12db1ba3 100644 --- a/source3/auth/token_util.c +++ b/source3/auth/token_util.c @@ -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, |