Sebastian Lackner : server: Fix assignment of primary_group in token_duplicate.

Alexandre Julliard julliard at winehq.org
Mon Aug 22 07:32:39 CDT 2016


Module: wine
Branch: stable
Commit: 7681b1f894e13d63fbbc0f2499f96e9f194c4df7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7681b1f894e13d63fbbc0f2499f96e9f194c4df7

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Mon Dec 21 05:32:35 2015 +0100

server: Fix assignment of primary_group in token_duplicate.

Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 25b0a4981b137dcbf52dc18e85690fba11e2488b)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 server/token.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/server/token.c b/server/token.c
index 42cfb3d..6c2871f 100644
--- a/server/token.c
+++ b/server/token.c
@@ -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 */




More information about the wine-cvs mailing list