check for immutable bits in RtlSetControlSecurityDescriptor

fixes >100 advapi32 security winetests

svn path=/trunk/; revision=40519
This commit is contained in:
Christoph von Wittich 2009-04-15 08:33:57 +00:00
parent e8ecddc002
commit d748120ca1

View file

@ -667,6 +667,13 @@ RtlSetControlSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
IN SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
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;
PAGED_CODE_RTL();
@ -676,6 +683,9 @@ RtlSetControlSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor,
return STATUS_UNKNOWN_REVISION;
}
if ((ControlBitsOfInterest | ControlBitsToSet) & immutable)
return STATUS_INVALID_PARAMETER;
/* Zero the 'bits of interest' */
pSD->Control &= ~ControlBitsOfInterest;