summaryrefslogtreecommitdiff
path: root/source3/auth/token_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/auth/token_util.c')
-rw-r--r--source3/auth/token_util.c22
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,