mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 22:43:04 +00:00
Assign a security descriptor to the root directory object.
svn path=/trunk/; revision=10185
This commit is contained in:
parent
23dac2681b
commit
491fa2e1ef
1 changed files with 31 additions and 7 deletions
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: namespc.c,v 1.45 2004/07/16 17:19:15 ekohl Exp $
|
/* $Id: namespc.c,v 1.46 2004/07/17 20:34:42 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -17,6 +17,7 @@
|
||||||
#include <internal/ob.h>
|
#include <internal/ob.h>
|
||||||
#include <internal/io.h>
|
#include <internal/io.h>
|
||||||
#include <internal/pool.h>
|
#include <internal/pool.h>
|
||||||
|
#include <internal/se.h>
|
||||||
#include <rosrtl/string.h>
|
#include <rosrtl/string.h>
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
|
@ -348,6 +349,7 @@ ObInit(VOID)
|
||||||
{
|
{
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
UNICODE_STRING Name;
|
UNICODE_STRING Name;
|
||||||
|
SECURITY_DESCRIPTOR SecurityDescriptor;
|
||||||
|
|
||||||
/* Initialize the security descriptor cache */
|
/* Initialize the security descriptor cache */
|
||||||
ObpInitSdCache();
|
ObpInitSdCache();
|
||||||
|
@ -373,7 +375,7 @@ ObInit(VOID)
|
||||||
ObDirectoryType->OkayToClose = NULL;
|
ObDirectoryType->OkayToClose = NULL;
|
||||||
ObDirectoryType->Create = ObpCreateDirectory;
|
ObDirectoryType->Create = ObpCreateDirectory;
|
||||||
ObDirectoryType->DuplicationNotify = NULL;
|
ObDirectoryType->DuplicationNotify = NULL;
|
||||||
|
|
||||||
RtlRosInitUnicodeStringFromLiteral(&ObDirectoryType->TypeName,
|
RtlRosInitUnicodeStringFromLiteral(&ObDirectoryType->TypeName,
|
||||||
L"Directory");
|
L"Directory");
|
||||||
|
|
||||||
|
@ -398,14 +400,36 @@ ObInit(VOID)
|
||||||
ObTypeObjectType->OkayToClose = NULL;
|
ObTypeObjectType->OkayToClose = NULL;
|
||||||
ObTypeObjectType->Create = NULL;
|
ObTypeObjectType->Create = NULL;
|
||||||
ObTypeObjectType->DuplicationNotify = NULL;
|
ObTypeObjectType->DuplicationNotify = NULL;
|
||||||
|
|
||||||
RtlRosInitUnicodeStringFromLiteral(&ObTypeObjectType->TypeName,
|
RtlRosInitUnicodeStringFromLiteral(&ObTypeObjectType->TypeName,
|
||||||
L"ObjectType");
|
L"ObjectType");
|
||||||
|
|
||||||
/* create root directory */
|
/* Create security descriptor */
|
||||||
|
RtlCreateSecurityDescriptor(&SecurityDescriptor,
|
||||||
|
SECURITY_DESCRIPTOR_REVISION1);
|
||||||
|
|
||||||
|
RtlSetOwnerSecurityDescriptor(&SecurityDescriptor,
|
||||||
|
SeAliasAdminsSid,
|
||||||
|
FALSE);
|
||||||
|
|
||||||
|
RtlSetGroupSecurityDescriptor(&SecurityDescriptor,
|
||||||
|
SeLocalSystemSid,
|
||||||
|
FALSE);
|
||||||
|
|
||||||
|
RtlSetDaclSecurityDescriptor(&SecurityDescriptor,
|
||||||
|
TRUE,
|
||||||
|
SePublicDefaultDacl,
|
||||||
|
FALSE);
|
||||||
|
|
||||||
|
/* Create root directory */
|
||||||
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
|
NULL,
|
||||||
|
OBJ_PERMANENT,
|
||||||
|
NULL,
|
||||||
|
&SecurityDescriptor);
|
||||||
ObCreateObject(KernelMode,
|
ObCreateObject(KernelMode,
|
||||||
ObDirectoryType,
|
ObDirectoryType,
|
||||||
NULL,
|
&ObjectAttributes,
|
||||||
KernelMode,
|
KernelMode,
|
||||||
NULL,
|
NULL,
|
||||||
sizeof(DIRECTORY_OBJECT),
|
sizeof(DIRECTORY_OBJECT),
|
||||||
|
@ -413,14 +437,14 @@ ObInit(VOID)
|
||||||
0,
|
0,
|
||||||
(PVOID*)&NameSpaceRoot);
|
(PVOID*)&NameSpaceRoot);
|
||||||
|
|
||||||
/* create '\ObjectTypes' directory */
|
/* Create '\ObjectTypes' directory */
|
||||||
RtlRosInitUnicodeStringFromLiteral(&Name,
|
RtlRosInitUnicodeStringFromLiteral(&Name,
|
||||||
L"\\ObjectTypes");
|
L"\\ObjectTypes");
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&Name,
|
&Name,
|
||||||
OBJ_PERMANENT,
|
OBJ_PERMANENT,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
&SecurityDescriptor);
|
||||||
ObCreateObject(KernelMode,
|
ObCreateObject(KernelMode,
|
||||||
ObDirectoryType,
|
ObDirectoryType,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue