mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[NTOSKRNL] Use the security descriptor for all the symlinks
This commit is contained in:
parent
95d303bf13
commit
fe6c7f05e2
1 changed files with 13 additions and 9 deletions
|
@ -169,14 +169,13 @@ ObpCreateDosDevicesDirectory(VOID)
|
||||||
Status = NtCreateDirectoryObject(&Handle,
|
Status = NtCreateDirectoryObject(&Handle,
|
||||||
DIRECTORY_ALL_ACCESS,
|
DIRECTORY_ALL_ACCESS,
|
||||||
&ObjectAttributes);
|
&ObjectAttributes);
|
||||||
RtlGetDaclSecurityDescriptor(&DosDevicesSD, &DaclPresent, &Dacl, &DaclDefaulted);
|
if (!NT_SUCCESS(Status))
|
||||||
ExFreePoolWithTag(Dacl, 'lcaD');
|
goto done;
|
||||||
if (!NT_SUCCESS(Status)) return Status;
|
|
||||||
|
|
||||||
/* Create the system device map */
|
/* Create the system device map */
|
||||||
Status = ObpCreateDeviceMap(Handle);
|
Status = ObpCreateDeviceMap(Handle);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
return Status;
|
goto done;
|
||||||
|
|
||||||
/*********************************************\
|
/*********************************************\
|
||||||
|*** HACK until we support device mappings ***|
|
|*** HACK until we support device mappings ***|
|
||||||
|
@ -187,7 +186,7 @@ ObpCreateDosDevicesDirectory(VOID)
|
||||||
&LinkName,
|
&LinkName,
|
||||||
OBJ_PERMANENT,
|
OBJ_PERMANENT,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
&DosDevicesSD);
|
||||||
Status = NtCreateSymbolicLinkObject(&SymHandle,
|
Status = NtCreateSymbolicLinkObject(&SymHandle,
|
||||||
SYMBOLIC_LINK_ALL_ACCESS,
|
SYMBOLIC_LINK_ALL_ACCESS,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
|
@ -208,7 +207,7 @@ ObpCreateDosDevicesDirectory(VOID)
|
||||||
&LinkName,
|
&LinkName,
|
||||||
OBJ_PERMANENT,
|
OBJ_PERMANENT,
|
||||||
Handle,
|
Handle,
|
||||||
NULL);
|
&DosDevicesSD);
|
||||||
Status = NtCreateSymbolicLinkObject(&SymHandle,
|
Status = NtCreateSymbolicLinkObject(&SymHandle,
|
||||||
SYMBOLIC_LINK_ALL_ACCESS,
|
SYMBOLIC_LINK_ALL_ACCESS,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
|
@ -226,7 +225,7 @@ ObpCreateDosDevicesDirectory(VOID)
|
||||||
&LinkName,
|
&LinkName,
|
||||||
OBJ_PERMANENT,
|
OBJ_PERMANENT,
|
||||||
Handle,
|
Handle,
|
||||||
NULL);
|
&DosDevicesSD);
|
||||||
Status = NtCreateSymbolicLinkObject(&SymHandle,
|
Status = NtCreateSymbolicLinkObject(&SymHandle,
|
||||||
SYMBOLIC_LINK_ALL_ACCESS,
|
SYMBOLIC_LINK_ALL_ACCESS,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
|
@ -235,7 +234,8 @@ ObpCreateDosDevicesDirectory(VOID)
|
||||||
|
|
||||||
/* Close the directory handle */
|
/* Close the directory handle */
|
||||||
NtClose(Handle);
|
NtClose(Handle);
|
||||||
if (!NT_SUCCESS(Status)) return Status;
|
if (!NT_SUCCESS(Status))
|
||||||
|
goto done;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize the \DosDevices symbolic link pointing to the global
|
* Initialize the \DosDevices symbolic link pointing to the global
|
||||||
|
@ -248,13 +248,17 @@ ObpCreateDosDevicesDirectory(VOID)
|
||||||
&LinkName,
|
&LinkName,
|
||||||
OBJ_PERMANENT,
|
OBJ_PERMANENT,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
&DosDevicesSD);
|
||||||
Status = NtCreateSymbolicLinkObject(&SymHandle,
|
Status = NtCreateSymbolicLinkObject(&SymHandle,
|
||||||
SYMBOLIC_LINK_ALL_ACCESS,
|
SYMBOLIC_LINK_ALL_ACCESS,
|
||||||
&ObjectAttributes,
|
&ObjectAttributes,
|
||||||
&RootName);
|
&RootName);
|
||||||
if (NT_SUCCESS(Status)) NtClose(SymHandle);
|
if (NT_SUCCESS(Status)) NtClose(SymHandle);
|
||||||
|
|
||||||
|
done:
|
||||||
|
RtlGetDaclSecurityDescriptor(&DosDevicesSD, &DaclPresent, &Dacl, &DaclDefaulted);
|
||||||
|
ExFreePoolWithTag(Dacl, 'lcaD');
|
||||||
|
|
||||||
/* Return status */
|
/* Return status */
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue