mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 01:45:40 +00:00
check for immutable bits in RtlSetControlSecurityDescriptor
fixes >100 advapi32 security winetests svn path=/trunk/; revision=40519
This commit is contained in:
parent
e8ecddc002
commit
d748120ca1
1 changed files with 10 additions and 0 deletions
|
@ -667,6 +667,13 @@ RtlSetControlSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
|
||||||
IN SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
|
IN SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
|
||||||
IN SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet)
|
IN SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet)
|
||||||
{
|
{
|
||||||
|
SECURITY_DESCRIPTOR_CONTROL const immutable
|
||||||
|
= SE_OWNER_DEFAULTED | SE_GROUP_DEFAULTED
|
||||||
|
| SE_DACL_PRESENT | SE_DACL_DEFAULTED
|
||||||
|
| SE_SACL_PRESENT | SE_SACL_DEFAULTED
|
||||||
|
| SE_RM_CONTROL_VALID | SE_SELF_RELATIVE
|
||||||
|
;
|
||||||
|
|
||||||
PISECURITY_DESCRIPTOR pSD = (PISECURITY_DESCRIPTOR)SecurityDescriptor;
|
PISECURITY_DESCRIPTOR pSD = (PISECURITY_DESCRIPTOR)SecurityDescriptor;
|
||||||
|
|
||||||
PAGED_CODE_RTL();
|
PAGED_CODE_RTL();
|
||||||
|
@ -676,6 +683,9 @@ RtlSetControlSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
|
||||||
return STATUS_UNKNOWN_REVISION;
|
return STATUS_UNKNOWN_REVISION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((ControlBitsOfInterest | ControlBitsToSet) & immutable)
|
||||||
|
return STATUS_INVALID_PARAMETER;
|
||||||
|
|
||||||
/* Zero the 'bits of interest' */
|
/* Zero the 'bits of interest' */
|
||||||
pSD->Control &= ~ControlBitsOfInterest;
|
pSD->Control &= ~ControlBitsOfInterest;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue