mirror of
https://github.com/reactos/reactos.git
synced 2024-09-28 21:44:31 +00:00
[RTL] When taking system volume ownership, assert that we succeeded to restore privileges
CORE-17637
This commit is contained in:
parent
9c5b39e25a
commit
fb9ebe17bf
|
@ -412,7 +412,9 @@ Cleanup:
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS
|
_Must_inspect_result_
|
||||||
|
static
|
||||||
|
NTSTATUS
|
||||||
RtlpSysVolTakeOwnership(IN PUNICODE_STRING DirectoryPath,
|
RtlpSysVolTakeOwnership(IN PUNICODE_STRING DirectoryPath,
|
||||||
IN PSECURITY_DESCRIPTOR SecurityDescriptor)
|
IN PSECURITY_DESCRIPTOR SecurityDescriptor)
|
||||||
{
|
{
|
||||||
|
@ -511,12 +513,16 @@ RtlpSysVolTakeOwnership(IN PUNICODE_STRING DirectoryPath,
|
||||||
Cleanup:
|
Cleanup:
|
||||||
if (TokenEnabled)
|
if (TokenEnabled)
|
||||||
{
|
{
|
||||||
ZwAdjustPrivilegesToken(hToken,
|
/* Disable privileges that we had to enable, whetever the result was. */
|
||||||
FALSE,
|
NTSTATUS Status2 = ZwAdjustPrivilegesToken(hToken,
|
||||||
&TokenPrivileges,
|
FALSE,
|
||||||
0,
|
&TokenPrivileges,
|
||||||
NULL,
|
0,
|
||||||
NULL);
|
NULL,
|
||||||
|
NULL);
|
||||||
|
/* This must succeed */
|
||||||
|
ASSERT(NT_SUCCESS(Status2));
|
||||||
|
(void)Status2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AdminSid != NULL)
|
if (AdminSid != NULL)
|
||||||
|
|
Loading…
Reference in a new issue