server: Fix assignment of primary_group in token_duplicate.

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sebastian Lackner 2015-12-21 05:32:35 +01:00 committed by Alexandre Julliard
parent fe2f86e934
commit 25b0a4981b

View File

@ -559,6 +559,7 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
if (!token) return token;
/* copy groups */
token->primary_group = NULL;
LIST_FOR_EACH_ENTRY( group, &src_token->groups, struct group, entry )
{
size_t size = FIELD_OFFSET( struct group, sid.SubAuthority[group->sid.SubAuthorityCount] );
@ -570,8 +571,9 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
}
memcpy( newgroup, group, size );
list_add_tail( &token->groups, &newgroup->entry );
if (src_token->primary_group == &group->sid)
token->primary_group = &newgroup->sid;
}
token->primary_group = src_token->primary_group;
assert( token->primary_group );
/* copy privileges */