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
9e7e6d29
Commit
9e7e6d29
authored
Jul 19, 2022
by
Jinoh Kang
Committed by
Alexandre Julliard
Jul 20, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Test that default object owner match the token owner.
parent
67429f3a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
1 deletion
+31
-1
security.c
dlls/advapi32/tests/security.c
+31
-1
No files found.
dlls/advapi32/tests/security.c
View file @
9e7e6d29
...
...
@@ -1765,6 +1765,24 @@ static void test_AccessCheck(void)
HeapFree
(
GetProcessHeap
(),
0
,
PrivSet
);
}
static
TOKEN_OWNER
*
get_alloc_token_owner
(
HANDLE
token
)
{
TOKEN_OWNER
*
token_owner
;
DWORD
size
;
BOOL
ret
;
ret
=
GetTokenInformation
(
token
,
TokenOwner
,
NULL
,
0
,
&
size
);
ok
(
!
ret
,
"Expected failure, got %d
\n
"
,
ret
);
ok
(
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"Expected ERROR_INSUFFICIENT_BUFFER, got %ld
\n
"
,
GetLastError
());
token_owner
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
ret
=
GetTokenInformation
(
token
,
TokenOwner
,
token_owner
,
size
,
&
size
);
ok
(
ret
,
"GetTokenInformation failed with error %ld
\n
"
,
GetLastError
());
return
token_owner
;
}
/* test GetTokenInformation for the various attributes */
static
void
test_token_attr
(
void
)
{
...
...
@@ -6321,7 +6339,8 @@ static void test_TokenIntegrityLevel(void)
static
void
test_default_dacl_owner_sid
(
void
)
{
HANDLE
handle
;
TOKEN_OWNER
*
token_owner
;
HANDLE
handle
,
token
;
BOOL
ret
,
defaulted
,
present
,
found
;
DWORD
size
,
index
;
SECURITY_DESCRIPTOR
*
sd
;
...
...
@@ -6330,6 +6349,13 @@ static void test_default_dacl_owner_sid(void)
ACL
*
dacl
;
ACCESS_ALLOWED_ACE
*
ace
;
ret
=
OpenProcessToken
(
GetCurrentProcess
(),
TOKEN_QUERY
,
&
token
);
ok
(
ret
,
"OpenProcessToken failed with error %ld
\n
"
,
GetLastError
());
token_owner
=
get_alloc_token_owner
(
token
);
CloseHandle
(
token
);
sd
=
HeapAlloc
(
GetProcessHeap
(),
0
,
SECURITY_DESCRIPTOR_MIN_LENGTH
);
ret
=
InitializeSecurityDescriptor
(
sd
,
SECURITY_DESCRIPTOR_REVISION
);
ok
(
ret
,
"error %lu
\n
"
,
GetLastError
()
);
...
...
@@ -6354,6 +6380,8 @@ static void test_default_dacl_owner_sid(void)
ok
(
ret
,
"error %lu
\n
"
,
GetLastError
()
);
ok
(
owner
!=
(
void
*
)
0xdeadbeef
,
"owner not set
\n
"
);
ok
(
!
defaulted
,
"owner defaulted
\n
"
);
todo_wine
ok
(
EqualSid
(
owner
,
token_owner
->
Owner
),
"owner shall equal token owner
\n
"
);
dacl
=
(
void
*
)
0xdeadbeef
;
present
=
FALSE
;
...
...
@@ -6377,6 +6405,8 @@ static void test_default_dacl_owner_sid(void)
HeapFree
(
GetProcessHeap
(),
0
,
sa
.
lpSecurityDescriptor
);
HeapFree
(
GetProcessHeap
(),
0
,
sd
);
CloseHandle
(
handle
);
HeapFree
(
GetProcessHeap
(),
0
,
token_owner
);
}
static
void
test_AdjustTokenPrivileges
(
void
)
...
...
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