Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
5290766a
Commit
5290766a
authored
Aug 02, 2011
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 02, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Fix CheckTokenMemberShip for primary tokens.
parent
01fb0fdf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
security.c
dlls/advapi32/security.c
+13
-0
security.c
dlls/advapi32/tests/security.c
+4
-2
No files found.
dlls/advapi32/security.c
View file @
5290766a
...
...
@@ -607,6 +607,19 @@ CheckTokenMembership( HANDLE token, PSID sid_to_check,
}
token
=
thread_token
;
}
else
{
TOKEN_TYPE
type
;
ret
=
GetTokenInformation
(
token
,
TokenType
,
&
type
,
sizeof
(
TOKEN_TYPE
),
&
size
);
if
(
!
ret
)
goto
exit
;
if
(
type
==
TokenPrimary
)
{
SetLastError
(
ERROR_NO_IMPERSONATION_TOKEN
);
return
FALSE
;
}
}
ret
=
GetTokenInformation
(
token
,
TokenGroups
,
NULL
,
0
,
&
size
);
if
(
!
ret
&&
GetLastError
()
!=
ERROR_INSUFFICIENT_BUFFER
)
...
...
dlls/advapi32/tests/security.c
View file @
5290766a
...
...
@@ -3637,21 +3637,23 @@ static void test_CheckTokenMembership(void)
return
;
}
is_member
=
FALSE
;
ret
=
pCheckTokenMembership
(
token
,
token_groups
->
Groups
[
i
].
Sid
,
&
is_member
);
ok
(
ret
,
"CheckTokenMembership failed with error %d
\n
"
,
GetLastError
());
ok
(
is_member
,
"CheckTokenMembership should have detected sid as member
\n
"
);
is_member
=
FALSE
;
ret
=
pCheckTokenMembership
(
NULL
,
token_groups
->
Groups
[
i
].
Sid
,
&
is_member
);
ok
(
ret
,
"CheckTokenMembership failed with error %d
\n
"
,
GetLastError
());
ok
(
is_member
,
"CheckTokenMembership should have detected sid as member
\n
"
);
is_member
=
TRUE
;
SetLastError
(
0xdeadbeef
);
ret
=
pCheckTokenMembership
(
process_token
,
token_groups
->
Groups
[
i
].
Sid
,
&
is_member
);
todo_wine
{
ok
(
!
ret
&&
GetLastError
()
==
ERROR_NO_IMPERSONATION_TOKEN
,
"CheckTokenMembership with process token %s with error %d
\n
"
,
ret
?
"succeeded"
:
"failed"
,
GetLastError
());
ok
(
!
is_member
,
"CheckTokenMembership should have cleared is_member
\n
"
);
}
HeapFree
(
GetProcessHeap
(),
0
,
token_groups
);
CloseHandle
(
token
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment