[PATCH 1/2] server: Grant the same access rights when req->access is zero in duplicate_token.

Zebediah Figura z.figura12 at gmail.com
Sat Feb 6 18:26:59 CST 2021


From: Michael Müller <michael at fds-team.de>

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 server/token.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/token.c b/server/token.c
index ec2616098c6..2ae1cb1780a 100644
--- a/server/token.c
+++ b/server/token.c
@@ -1358,7 +1358,8 @@ DECL_HANDLER(duplicate_token)
         struct token *token = token_duplicate( src_token, req->primary, req->impersonation_level, sd, NULL, 0, NULL, 0 );
         if (token)
         {
-            reply->new_handle = alloc_handle_no_access_check( current->process, token, req->access, objattr->attributes );
+            unsigned int access = req->access ? req->access : get_handle_access( current->process, req->handle );
+            reply->new_handle = alloc_handle_no_access_check( current->process, token, access, objattr->attributes );
             release_object( token );
         }
         release_object( src_token );
-- 
2.20.1




More information about the wine-devel mailing list