don't copy the entire security descriptor to the stack in SeCaptureSecurityDescriptor() when previous mode is kernel mode and capturing for kernel mode is undesired

svn path=/trunk/; revision=13237
This commit is contained in:
Thomas Bluemel 2005-01-24 00:09:04 +00:00
parent 064504a61d
commit e453a1e961

View file

@ -154,18 +154,22 @@ SeCaptureSecurityDescriptor(
return Status; return Status;
} }
} }
else if(!CaptureIfKernel)
{
if(OriginalSecurityDescriptor->Revision != SECURITY_DESCRIPTOR_REVISION1)
{
return STATUS_UNKNOWN_REVISION;
}
*CapturedSecurityDescriptor = OriginalSecurityDescriptor;
return STATUS_SUCCESS;
}
else else
{ {
/* make a copy on the stack */ /* make a copy on the stack */
DescriptorCopy = *OriginalSecurityDescriptor; DescriptorCopy = *OriginalSecurityDescriptor;
} }
if(CurrentMode == KernelMode && !CaptureIfKernel)
{
*CapturedSecurityDescriptor = OriginalSecurityDescriptor;
return STATUS_SUCCESS;
}
if(DescriptorCopy.Revision != SECURITY_DESCRIPTOR_REVISION1) if(DescriptorCopy.Revision != SECURITY_DESCRIPTOR_REVISION1)
{ {
return STATUS_UNKNOWN_REVISION; return STATUS_UNKNOWN_REVISION;