mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 18:02:05 +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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -283,6 +283,8 @@ NtMakeTemporaryObject(IN HANDLE Handle)
|
||||||
* RETURN VALUE
|
* RETURN VALUE
|
||||||
*
|
*
|
||||||
* REVISIONS
|
* REVISIONS
|
||||||
|
*
|
||||||
|
* @implemented
|
||||||
*/
|
*/
|
||||||
NTSTATUS STDCALL
|
NTSTATUS STDCALL
|
||||||
NtMakePermanentObject(IN HANDLE Handle)
|
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
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -348,6 +348,7 @@ ObCreateObject (IN KPROCESSOR_MODE ObjectAttributesAccessMode OPTIONAL,
|
||||||
BOOLEAN ObjectAttached = FALSE;
|
BOOLEAN ObjectAttached = FALSE;
|
||||||
PWCHAR NamePtr;
|
PWCHAR NamePtr;
|
||||||
PSECURITY_DESCRIPTOR NewSecurityDescriptor = NULL;
|
PSECURITY_DESCRIPTOR NewSecurityDescriptor = NULL;
|
||||||
|
SECURITY_SUBJECT_CONTEXT SubjectContext;
|
||||||
|
|
||||||
assert_irql(APC_LEVEL);
|
assert_irql(APC_LEVEL);
|
||||||
|
|
||||||
|
@ -457,12 +458,14 @@ ObCreateObject (IN KPROCESSOR_MODE ObjectAttributesAccessMode OPTIONAL,
|
||||||
}
|
}
|
||||||
RtlFreeUnicodeString(&RemainingPath);
|
RtlFreeUnicodeString(&RemainingPath);
|
||||||
|
|
||||||
|
SeCaptureSubjectContext(&SubjectContext);
|
||||||
|
|
||||||
/* Build the new security descriptor */
|
/* Build the new security descriptor */
|
||||||
Status = SeAssignSecurity((ParentHeader != NULL) ? ParentHeader->SecurityDescriptor : NULL,
|
Status = SeAssignSecurity((ParentHeader != NULL) ? ParentHeader->SecurityDescriptor : NULL,
|
||||||
(ObjectAttributes != NULL) ? ObjectAttributes->SecurityDescriptor : NULL,
|
(ObjectAttributes != NULL) ? ObjectAttributes->SecurityDescriptor : NULL,
|
||||||
&NewSecurityDescriptor,
|
&NewSecurityDescriptor,
|
||||||
(Header->ObjectType == ObDirectoryType),
|
(Header->ObjectType == ObDirectoryType),
|
||||||
NULL, //SubjectContext,
|
&SubjectContext,
|
||||||
Header->ObjectType->Mapping,
|
Header->ObjectType->Mapping,
|
||||||
PagedPool);
|
PagedPool);
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
|
@ -486,6 +489,8 @@ ObCreateObject (IN KPROCESSOR_MODE ObjectAttributesAccessMode OPTIONAL,
|
||||||
SeDeassignSecurity(&NewSecurityDescriptor);
|
SeDeassignSecurity(&NewSecurityDescriptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SeReleaseSubjectContext(&SubjectContext);
|
||||||
|
|
||||||
if (Object != NULL)
|
if (Object != NULL)
|
||||||
{
|
{
|
||||||
*Object = HEADER_TO_BODY(Header);
|
*Object = HEADER_TO_BODY(Header);
|
||||||
|
|
Loading…
Reference in a new issue