don't copy the entire security descriptor to the stack in SeCaptureSecurityDescriptor...
authorThomas Bluemel <thomas@reactsoft.com>
Mon, 24 Jan 2005 00:09:04 +0000 (00:09 +0000)
committerThomas Bluemel <thomas@reactsoft.com>
Mon, 24 Jan 2005 00:09:04 +0000 (00:09 +0000)
svn path=/trunk/; revision=13237

reactos/ntoskrnl/se/sd.c

index a470015..01afd45 100644 (file)
@@ -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;