Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9aac7ca1
Commit
9aac7ca1
authored
Apr 25, 2019
by
Erich E. Hoover
Committed by
Alexandre Julliard
Apr 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Move the DACL combining code into a separate routine.
Signed-off-by:
Vijay Kiran Kamuju
<
infyquest@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
48821e2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
34 deletions
+45
-34
security.c
dlls/advapi32/security.c
+45
-34
No files found.
dlls/advapi32/security.c
View file @
9aac7ca1
...
...
@@ -5964,6 +5964,48 @@ BOOL WINAPI FileEncryptionStatusA(LPCSTR lpFileName, LPDWORD lpStatus)
return
TRUE
;
}
static
NTSTATUS
combine_dacls
(
ACL
*
parent
,
ACL
*
child
,
ACL
**
result
)
{
ACL
*
combined
;
int
i
;
/* initialize a combined DACL containing both inherited and new ACEs */
combined
=
heap_alloc_zero
(
child
->
AclSize
+
parent
->
AclSize
);
if
(
!
combined
)
return
STATUS_NO_MEMORY
;
memcpy
(
combined
,
child
,
child
->
AclSize
);
combined
->
AclSize
=
child
->
AclSize
+
parent
->
AclSize
;
/* copy the inherited ACEs */
for
(
i
=
0
;
i
<
parent
->
AceCount
;
i
++
)
{
ACE_HEADER
*
ace
;
if
(
!
GetAce
(
parent
,
i
,
(
void
*
)
&
ace
))
continue
;
if
(
!
(
ace
->
AceFlags
&
(
OBJECT_INHERIT_ACE
|
CONTAINER_INHERIT_ACE
)))
continue
;
if
((
ace
->
AceFlags
&
(
OBJECT_INHERIT_ACE
|
CONTAINER_INHERIT_ACE
))
!=
(
OBJECT_INHERIT_ACE
|
CONTAINER_INHERIT_ACE
))
{
FIXME
(
"unsupported flags: %x
\n
"
,
ace
->
AceFlags
);
continue
;
}
if
(
ace
->
AceFlags
&
NO_PROPAGATE_INHERIT_ACE
)
ace
->
AceFlags
&=
~
(
OBJECT_INHERIT_ACE
|
CONTAINER_INHERIT_ACE
|
NO_PROPAGATE_INHERIT_ACE
);
ace
->
AceFlags
&=
~
INHERIT_ONLY_ACE
;
ace
->
AceFlags
|=
INHERITED_ACE
;
if
(
!
AddAce
(
combined
,
ACL_REVISION
,
MAXDWORD
,
ace
,
ace
->
AceSize
))
WARN
(
"error adding inherited ACE
\n
"
);
}
*
result
=
combined
;
return
STATUS_SUCCESS
;
}
/******************************************************************************
* SetSecurityInfo [ADVAPI32.@]
*/
...
...
@@ -6063,41 +6105,10 @@ DWORD WINAPI SetSecurityInfo(HANDLE handle, SE_OBJECT_TYPE ObjectType,
if
(
!
err
)
{
int
i
;
dacl
=
heap_alloc_zero
(
pDacl
->
AclSize
+
parent_dacl
->
AclSize
);
if
(
!
dacl
)
{
LocalFree
(
parent_sd
);
return
ERROR_NOT_ENOUGH_MEMORY
;
}
memcpy
(
dacl
,
pDacl
,
pDacl
->
AclSize
);
dacl
->
AclSize
=
pDacl
->
AclSize
+
parent_dacl
->
AclSize
;
for
(
i
=
0
;
i
<
parent_dacl
->
AceCount
;
i
++
)
{
ACE_HEADER
*
ace
;
if
(
!
GetAce
(
parent_dacl
,
i
,
(
void
*
)
&
ace
))
continue
;
if
(
!
(
ace
->
AceFlags
&
(
OBJECT_INHERIT_ACE
|
CONTAINER_INHERIT_ACE
)))
continue
;
if
((
ace
->
AceFlags
&
(
OBJECT_INHERIT_ACE
|
CONTAINER_INHERIT_ACE
))
!=
(
OBJECT_INHERIT_ACE
|
CONTAINER_INHERIT_ACE
))
{
FIXME
(
"unsupported flags: %x
\n
"
,
ace
->
AceFlags
);
continue
;
}
if
(
ace
->
AceFlags
&
NO_PROPAGATE_INHERIT_ACE
)
ace
->
AceFlags
&=
~
(
OBJECT_INHERIT_ACE
|
CONTAINER_INHERIT_ACE
|
NO_PROPAGATE_INHERIT_ACE
);
ace
->
AceFlags
&=
~
INHERIT_ONLY_ACE
;
ace
->
AceFlags
|=
INHERITED_ACE
;
if
(
!
AddAce
(
dacl
,
ACL_REVISION
,
MAXDWORD
,
ace
,
ace
->
AceSize
))
WARN
(
"error adding inherited ACE
\n
"
);
}
status
=
combine_dacls
(
parent_dacl
,
pDacl
,
&
dacl
);
LocalFree
(
parent_sd
);
if
(
status
!=
STATUS_SUCCESS
)
return
RtlNtStatusToDosError
(
status
);
}
}
else
...
...
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