mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 09:50:02 +00:00
- Add @implemented tag to NtMakePermanentObject().
- Capture the security context before calling SeAsignSecurity() and release it later. svn path=/trunk/; revision=10227
This commit is contained in:
parent
ae95148c4b
commit
de32ec78dc
2 changed files with 10 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: ntobj.c,v 1.21 2004/07/17 12:08:21 ekohl Exp $
|
||||
/* $Id: ntobj.c,v 1.22 2004/07/19 12:48:59 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -283,6 +283,8 @@ NtMakeTemporaryObject(IN HANDLE Handle)
|
|||
* RETURN VALUE
|
||||
*
|
||||
* REVISIONS
|
||||
*
|
||||
* @implemented
|
||||
*/
|
||||
NTSTATUS STDCALL
|
||||
NtMakePermanentObject(IN HANDLE Handle)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $Id: object.c,v 1.79 2004/07/18 13:03:43 ekohl Exp $
|
||||
/* $Id: object.c,v 1.80 2004/07/19 12:48:59 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -348,6 +348,7 @@ ObCreateObject (IN KPROCESSOR_MODE ObjectAttributesAccessMode OPTIONAL,
|
|||
BOOLEAN ObjectAttached = FALSE;
|
||||
PWCHAR NamePtr;
|
||||
PSECURITY_DESCRIPTOR NewSecurityDescriptor = NULL;
|
||||
SECURITY_SUBJECT_CONTEXT SubjectContext;
|
||||
|
||||
assert_irql(APC_LEVEL);
|
||||
|
||||
|
@ -457,12 +458,14 @@ ObCreateObject (IN KPROCESSOR_MODE ObjectAttributesAccessMode OPTIONAL,
|
|||
}
|
||||
RtlFreeUnicodeString(&RemainingPath);
|
||||
|
||||
SeCaptureSubjectContext(&SubjectContext);
|
||||
|
||||
/* Build the new security descriptor */
|
||||
Status = SeAssignSecurity((ParentHeader != NULL) ? ParentHeader->SecurityDescriptor : NULL,
|
||||
(ObjectAttributes != NULL) ? ObjectAttributes->SecurityDescriptor : NULL,
|
||||
&NewSecurityDescriptor,
|
||||
(Header->ObjectType == ObDirectoryType),
|
||||
NULL, //SubjectContext,
|
||||
&SubjectContext,
|
||||
Header->ObjectType->Mapping,
|
||||
PagedPool);
|
||||
if (NT_SUCCESS(Status))
|
||||
|
@ -486,6 +489,8 @@ ObCreateObject (IN KPROCESSOR_MODE ObjectAttributesAccessMode OPTIONAL,
|
|||
SeDeassignSecurity(&NewSecurityDescriptor);
|
||||
}
|
||||
|
||||
SeReleaseSubjectContext(&SubjectContext);
|
||||
|
||||
if (Object != NULL)
|
||||
{
|
||||
*Object = HEADER_TO_BODY(Header);
|
||||
|
|
Loading…
Reference in a new issue