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
9f96664d
Commit
9f96664d
authored
Jun 29, 2005
by
James Hawkins
Committed by
Alexandre Julliard
Jun 29, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fix calculation of generic pointers.
- Minor cleanups.
parent
645bb9f6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
19 deletions
+16
-19
security.c
dlls/advapi32/tests/security.c
+2
-2
sec.c
dlls/ntdll/sec.c
+14
-17
No files found.
dlls/advapi32/tests/security.c
View file @
9f96664d
...
...
@@ -518,14 +518,14 @@ static void test_AccessCheck(void)
ret
=
AccessCheck
(
SecurityDescriptor
,
Token
,
KEY_READ
,
&
Mapping
,
PrivSet
,
&
PrivSetLen
,
&
Access
,
&
AccessStatus
);
ok
(
ret
,
"AccessCheck failed with error %ld
\n
"
,
GetLastError
());
todo_wine
ok
(
AccessStatus
&&
(
Access
==
KEY_READ
),
ok
(
AccessStatus
&&
(
Access
==
KEY_READ
),
"AccessCheck failed to grant access with error %ld
\n
"
,
GetLastError
());
ret
=
AccessCheck
(
SecurityDescriptor
,
Token
,
MAXIMUM_ALLOWED
,
&
Mapping
,
PrivSet
,
&
PrivSetLen
,
&
Access
,
&
AccessStatus
);
ok
(
ret
,
"AccessCheck failed with error %ld
\n
"
,
GetLastError
());
todo_wine
ok
(
AccessStatus
,
ok
(
AccessStatus
,
"AccessCheck failed to grant any access with error %ld
\n
"
,
GetLastError
());
trace
(
"AccessCheck with MAXIMUM_ALLOWED got Access 0x%08lx
\n
"
,
Access
);
...
...
dlls/ntdll/sec.c
View file @
9f96664d
...
...
@@ -71,24 +71,18 @@ static BOOLEAN copy_acl(DWORD nDestinationAclLength, PACL pDestinationAcl, PACL
static
NTSTATUS
add_access_ace
(
PACL
pAcl
,
DWORD
dwAceRevision
,
DWORD
dwAceFlags
,
DWORD
dwAccessMask
,
PSID
pSid
,
DWORD
dwAceType
)
{
SID
*
sid
=
(
SID
*
)
pSid
;
ACE_HEADER
*
pAceHeader
;
DWORD
dwLengthSid
;
DWORD
dwAceSize
;
DWORD
dwSidStart
;
DWORD
sidLength
;
PDWORD
pAccessMask
;
DWORD
*
pAccessMask
;
DWORD
*
pSidStart
;
if
(
!
RtlValidSid
(
s
id
))
if
(
!
RtlValidSid
(
pS
id
))
return
STATUS_INVALID_SID
;
if
(
pAcl
->
AclRevision
>
MAX_ACL_REVISION
||
dwAceRevision
>
MAX_ACL_REVISION
)
return
STATUS_REVISION_MISMATCH
;
/* choose the higher of the two revisions */
sid
->
IdentifierAuthority
.
Value
[
1
]
=
pAcl
->
AclRevision
;
if
(
dwAceRevision
>
pAcl
->
AclRevision
)
sid
->
IdentifierAuthority
.
Value
[
1
]
=
dwAceRevision
;
if
(
!
RtlValidAcl
(
pAcl
))
return
STATUS_INVALID_ACL
;
...
...
@@ -99,22 +93,25 @@ static NTSTATUS add_access_ace(PACL pAcl, DWORD dwAceRevision, DWORD dwAceFlags,
return
STATUS_ALLOTTED_SPACE_EXCEEDED
;
/* calculate generic size of the ACE */
sidLength
=
RtlLengthSid
(
s
id
);
dwAceSize
=
sizeof
(
ACE_HEADER
)
+
sizeof
(
DWORD
)
+
sidLength
;
dwLengthSid
=
RtlLengthSid
(
pS
id
);
dwAceSize
=
sizeof
(
ACE_HEADER
)
+
sizeof
(
DWORD
)
+
dwLengthSid
;
if
((
DWORD
)(
pAceHeader
+
dwAceSize
)
>
(
DWORD
)(
pAcl
+
pAcl
->
AclSize
))
return
STATUS_ALLOTTED_SPACE_EXCEEDED
;
/* fill the new A
ce
*/
/* fill the new A
CE
*/
pAceHeader
->
AceType
=
dwAceType
;
pAceHeader
->
AceFlags
=
dwAceFlags
;
pAceHeader
->
AceSize
=
dwAceSize
;
pAccessMask
=
(
DWORD
*
)(
pAceHeader
+
sizeof
(
ACE_HEADER
));
/* skip past the ACE_HEADER of the ACE */
pAccessMask
=
(
DWORD
*
)(
pAceHeader
+
1
);
*
pAccessMask
=
dwAccessMask
;
dwSidStart
=
(
DWORD
)(
pAceHeader
+
sizeof
(
ACE_HEADER
)
+
sizeof
(
DWORD
));
RtlCopySid
(
sidLength
,
(
PSID
)
dwSidStart
,
sid
);
/* skip past ACE->Mask */
pSidStart
=
pAccessMask
+
1
;
RtlCopySid
(
dwLengthSid
,
(
PSID
)
pSidStart
,
pSid
);
pAcl
->
AclRevision
=
sid
->
IdentifierAuthority
.
Value
[
1
]
;
pAcl
->
AclRevision
=
max
(
pAcl
->
AclRevision
,
dwAceRevision
)
;
pAcl
->
AceCount
++
;
return
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