summaryrefslogtreecommitdiff
path: root/source3/auth
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2015-03-10 21:09:53 +0100
committerJeremy Allison <jra@samba.org>2015-03-11 16:11:08 +0100
commit05cec933bdff4228291195d387c08bfcbf7a872a (patch)
tree96c36397dea70dd8a0719dea6ecec668c6cec1e0 /source3/auth
parent64a0724c6e69040f51c350e0e10f9d838f34c6b7 (diff)
downloadsamba-05cec933bdff4228291195d387c08bfcbf7a872a.tar.gz
smbd: Simplify create_token_from_sid()
With the previous commit all 3 branches do the same Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/auth')
-rw-r--r--source3/auth/token_util.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/source3/auth/token_util.c b/source3/auth/token_util.c
index bb87be34c4c..6129cadb48c 100644
--- a/source3/auth/token_util.c
+++ b/source3/auth/token_util.c
@@ -716,8 +716,6 @@ static NTSTATUS create_token_from_sid(TALLOC_CTX *mem_ctx,
/* see the smb_panic() in pdb_default_enum_group_memberships */
SMB_ASSERT(num_group_sids > 0);
- *gid = gids[0];
-
/* Ensure we're returning the found_username on the right context. */
*found_username = talloc_strdup(mem_ctx,
pdb_get_username(sam_acct));
@@ -813,8 +811,6 @@ static NTSTATUS create_token_from_sid(TALLOC_CTX *mem_ctx,
/* In getgroups_unix_user we always set the primary gid */
SMB_ASSERT(num_group_sids > 0);
- *gid = gids[0];
-
/* Ensure we're returning the found_username on the right context. */
*found_username = talloc_strdup(mem_ctx, pass->pw_name);
if (*found_username == NULL) {
@@ -862,11 +858,11 @@ static NTSTATUS create_token_from_sid(TALLOC_CTX *mem_ctx,
goto done;
}
- *gid = gids[0];
-
*found_username = NULL;
}
+ *gid = gids[0];
+
/* Add the "Unix Group" SID for each gid to catch mapped groups
and their Unix equivalent. This is to solve the backwards
compatibility problem of 'valid users = +ntadmin' where