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
bdc10c65
Commit
bdc10c65
authored
Feb 07, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Always return at least sizeof(PRIVILEGE_SET) in NtAccessCheck().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f9d2db93
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
9 deletions
+3
-9
security.c
dlls/advapi32/tests/security.c
+2
-8
security.c
dlls/ntdll/unix/security.c
+1
-1
No files found.
dlls/advapi32/tests/security.c
View file @
bdc10c65
...
...
@@ -1374,7 +1374,7 @@ static void test_AccessCheck(void)
"NtAccessCheck shouldn't set last error, got %d
\n
"
,
err
);
todo_wine
ok
(
Access
==
0x1abe11ed
&&
ntAccessStatus
==
0x1abe11ed
,
"Access and/or AccessStatus were changed!
\n
"
);
todo_wine
ok
(
ntPrivSetLen
==
sizeof
(
PRIVILEGE_SET
),
"PrivSetLen returns %d
\n
"
,
ntPrivSetLen
);
ok
(
ntPrivSetLen
==
sizeof
(
PRIVILEGE_SET
),
"PrivSetLen returns %d
\n
"
,
ntPrivSetLen
);
/* Key access mask - insufficient returnlength */
SetLastError
(
0xdeadbeef
);
...
...
@@ -1389,7 +1389,7 @@ static void test_AccessCheck(void)
"NtAccessCheck shouldn't set last error, got %d
\n
"
,
err
);
todo_wine
ok
(
Access
==
0x1abe11ed
&&
ntAccessStatus
==
0x1abe11ed
,
"Access and/or AccessStatus were changed!
\n
"
);
todo_wine
ok
(
ntPrivSetLen
==
sizeof
(
PRIVILEGE_SET
),
"PrivSetLen returns %d
\n
"
,
ntPrivSetLen
);
ok
(
ntPrivSetLen
==
sizeof
(
PRIVILEGE_SET
),
"PrivSetLen returns %d
\n
"
,
ntPrivSetLen
);
}
else
win_skip
(
"NtAccessCheck unavailable. Skipping.
\n
"
);
...
...
@@ -1520,7 +1520,6 @@ todo_wine
todo_wine
ok
(
!
ret
&&
err
==
ERROR_INSUFFICIENT_BUFFER
,
"AccessCheck should have "
"failed with ERROR_INSUFFICIENT_BUFFER, instead of %d
\n
"
,
err
);
todo_wine
ok
(
PrivSetLen
==
sizeof
(
PRIVILEGE_SET
),
"PrivSetLen returns %d
\n
"
,
PrivSetLen
);
todo_wine
ok
(
Access
==
0x1abe11ed
&&
AccessStatus
==
0x1abe11ed
,
...
...
@@ -1536,7 +1535,6 @@ todo_wine
todo_wine
ok
(
!
ret
&&
err
==
ERROR_INSUFFICIENT_BUFFER
,
"AccessCheck should have "
"failed with ERROR_INSUFFICIENT_BUFFER, instead of %d
\n
"
,
err
);
todo_wine
ok
(
PrivSetLen
==
sizeof
(
PRIVILEGE_SET
),
"PrivSetLen returns %d
\n
"
,
PrivSetLen
);
todo_wine
ok
(
Access
==
0x1abe11ed
&&
AccessStatus
==
0x1abe11ed
,
...
...
@@ -1552,7 +1550,6 @@ todo_wine
todo_wine
ok
(
!
ret
&&
err
==
ERROR_INSUFFICIENT_BUFFER
,
"AccessCheck should have "
"failed with ERROR_INSUFFICIENT_BUFFER, instead of %d
\n
"
,
err
);
todo_wine
ok
(
PrivSetLen
==
sizeof
(
PRIVILEGE_SET
),
"PrivSetLen returns %d
\n
"
,
PrivSetLen
);
todo_wine
ok
(
Access
==
0x1abe11ed
&&
AccessStatus
==
0x1abe11ed
,
...
...
@@ -1567,7 +1564,6 @@ todo_wine
PrivSet
,
&
PrivSetLen
,
&
Access
,
&
AccessStatus
);
err
=
GetLastError
();
ok
(
ret
,
"AccessCheck failed with error %d
\n
"
,
GetLastError
());
todo_wine
ok
(
PrivSetLen
==
sizeof
(
PRIVILEGE_SET
),
"PrivSetLen returns %d
\n
"
,
PrivSetLen
);
ok
(
AccessStatus
&&
(
Access
==
KEY_READ
),
"AccessCheck failed to grant access with error %d
\n
"
,
GetLastError
());
...
...
@@ -1637,7 +1633,6 @@ todo_wine
todo_wine
ok
(
!
ret
&&
err
==
ERROR_INSUFFICIENT_BUFFER
,
"AccessCheck should have "
"failed with ERROR_INSUFFICIENT_BUFFER, instead of %d
\n
"
,
err
);
todo_wine
ok
(
PrivSetLen
==
sizeof
(
PRIVILEGE_SET
),
"PrivSetLen returns %d
\n
"
,
PrivSetLen
);
todo_wine
ok
(
Access
==
0x1abe11ed
&&
AccessStatus
==
0x1abe11ed
,
...
...
@@ -1653,7 +1648,6 @@ todo_wine
todo_wine
ok
(
!
ret
&&
err
==
ERROR_INSUFFICIENT_BUFFER
,
"AccessCheck should have "
"failed with ERROR_INSUFFICIENT_BUFFER, instead of %d
\n
"
,
err
);
todo_wine
ok
(
PrivSetLen
==
sizeof
(
PRIVILEGE_SET
),
"PrivSetLen returns %d
\n
"
,
PrivSetLen
);
todo_wine
ok
(
Access
==
0x1abe11ed
&&
AccessStatus
==
0x1abe11ed
,
...
...
dlls/ntdll/unix/security.c
View file @
bdc10c65
...
...
@@ -732,7 +732,7 @@ NTSTATUS WINAPI NtAccessCheck( PSECURITY_DESCRIPTOR descr, HANDLE token, ACCESS_
status
=
wine_server_call
(
req
);
*
retlen
=
offsetof
(
PRIVILEGE_SET
,
Privilege
)
+
reply
->
privileges_len
;
*
retlen
=
max
(
offsetof
(
PRIVILEGE_SET
,
Privilege
)
+
reply
->
privileges_len
,
sizeof
(
PRIVILEGE_SET
)
)
;
privs
->
PrivilegeCount
=
reply
->
privileges_len
/
sizeof
(
LUID_AND_ATTRIBUTES
);
if
(
status
==
STATUS_SUCCESS
)
{
...
...
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