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
2cbed066
Commit
2cbed066
authored
Jun 30, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Test the type and impersonation level of a linked token.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
17716bc7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
security.c
dlls/advapi32/tests/security.c
+21
-1
No files found.
dlls/advapi32/tests/security.c
View file @
2cbed066
...
...
@@ -8139,6 +8139,12 @@ static void test_elevation(void)
ret
=
GetTokenInformation
(
linked
.
LinkedToken
,
TokenElevation
,
&
elevation
,
sizeof
(
elevation
),
&
size
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
ok
(
elevation
.
TokenIsElevated
==
TRUE
,
"got elevation %#x
\n
"
,
elevation
.
TokenIsElevated
);
ret
=
GetTokenInformation
(
linked
.
LinkedToken
,
TokenType
,
&
type
,
sizeof
(
type
),
&
size
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
ok
(
type
==
TokenImpersonation
,
"got type %#x
\n
"
,
type
);
ret
=
GetTokenInformation
(
linked
.
LinkedToken
,
TokenImpersonationLevel
,
&
type
,
sizeof
(
type
),
&
size
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
ok
(
type
==
SecurityIdentification
,
"got impersonation level %#x
\n
"
,
type
);
/* Asking for the linked token again gives us a different token. */
ret
=
GetTokenInformation
(
token
,
TokenLinkedToken
,
&
linked2
,
sizeof
(
linked2
),
&
size
);
...
...
@@ -8194,6 +8200,12 @@ static void test_elevation(void)
ret
=
GetTokenInformation
(
linked
.
LinkedToken
,
TokenElevation
,
&
elevation
,
sizeof
(
elevation
),
&
size
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
ok
(
elevation
.
TokenIsElevated
==
FALSE
,
"got elevation %#x
\n
"
,
elevation
.
TokenIsElevated
);
ret
=
GetTokenInformation
(
linked
.
LinkedToken
,
TokenType
,
&
type
,
sizeof
(
type
),
&
size
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
todo_wine
ok
(
type
==
TokenImpersonation
,
"got type %#x
\n
"
,
type
);
ret
=
GetTokenInformation
(
linked
.
LinkedToken
,
TokenImpersonationLevel
,
&
type
,
sizeof
(
type
),
&
size
);
todo_wine
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
ok
(
type
==
SecurityIdentification
,
"got impersonation level %#x
\n
"
,
type
);
/* Asking for the linked token again gives us a different token. */
ret
=
GetTokenInformation
(
token
,
TokenLinkedToken
,
&
linked2
,
sizeof
(
linked2
),
&
size
);
...
...
@@ -8249,10 +8261,18 @@ static void test_elevation(void)
ret
=
GetTokenInformation
(
token2
,
TokenLinkedToken
,
&
linked
,
sizeof
(
linked
),
&
size
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
if
(
type
==
TokenElevationTypeDefault
)
{
ok
(
!
linked
.
LinkedToken
,
"expected no linked token
\n
"
);
ret
=
GetTokenInformation
(
linked
.
LinkedToken
,
TokenType
,
&
type
,
sizeof
(
type
),
&
size
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
ok
(
type
==
TokenImpersonation
,
"got type %#x
\n
"
,
type
);
ret
=
GetTokenInformation
(
linked
.
LinkedToken
,
TokenImpersonationLevel
,
&
type
,
sizeof
(
type
),
&
size
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
ok
(
type
==
SecurityIdentification
,
"got impersonation level %#x
\n
"
,
type
);
CloseHandle
(
linked
.
LinkedToken
);
}
else
ok
(
!!
linked
.
LinkedToken
,
"expected a linked token
\n
"
);
CloseHandle
(
linked
.
LinkedToken
);
CloseHandle
(
token2
);
ret
=
CreateRestrictedToken
(
token
,
0
,
0
,
NULL
,
0
,
NULL
,
0
,
NULL
,
&
token2
);
...
...
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