mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
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:
parent
064504a61d
commit
e453a1e961
1 changed files with 10 additions and 6 deletions
|
@ -154,18 +154,22 @@ SeCaptureSecurityDescriptor(
|
|||
return Status;
|
||||
}
|
||||
}
|
||||
else if(!CaptureIfKernel)
|
||||
{
|
||||
if(OriginalSecurityDescriptor->Revision != SECURITY_DESCRIPTOR_REVISION1)
|
||||
{
|
||||
return STATUS_UNKNOWN_REVISION;
|
||||
}
|
||||
|
||||
*CapturedSecurityDescriptor = OriginalSecurityDescriptor;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* make a copy on the stack */
|
||||
DescriptorCopy = *OriginalSecurityDescriptor;
|
||||
}
|
||||
|
||||
if(CurrentMode == KernelMode && !CaptureIfKernel)
|
||||
{
|
||||
*CapturedSecurityDescriptor = OriginalSecurityDescriptor;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if(DescriptorCopy.Revision != SECURITY_DESCRIPTOR_REVISION1)
|
||||
{
|
||||
return STATUS_UNKNOWN_REVISION;
|
||||
|
|
Loading…
Reference in a new issue