mirror of
https://github.com/reactos/reactos.git
synced 2024-11-18 13:01:40 +00:00
[LSASRV]
LsarSetSecurityObject: Impersonate the client and retrieve the client token when the owner sid will be set. svn path=/trunk/; revision=72449
This commit is contained in:
parent
15d8c32ada
commit
1161db9756
1 changed files with 20 additions and 11 deletions
|
@ -372,18 +372,27 @@ NTSTATUS WINAPI LsarSetSecurityObject(
|
|||
if (!NT_SUCCESS(Status))
|
||||
goto done;
|
||||
|
||||
#if 0
|
||||
RpcImpersonateClient(NULL);
|
||||
/* Get the clients token if we try to set the owner */
|
||||
if (SecurityInformation & OWNER_SECURITY_INFORMATION)
|
||||
{
|
||||
Status = I_RpcMapWin32Status(RpcImpersonateClient(NULL));
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
ERR("RpcImpersonateClient returns 0x%08lx\n", Status);
|
||||
goto done;
|
||||
}
|
||||
|
||||
Status = NtOpenThreadToken(NtCurrentThread(),
|
||||
8,
|
||||
TRUE,
|
||||
&hToken);
|
||||
if (!NT_SUCCESS(Status))
|
||||
goto done;
|
||||
|
||||
RpcRevertToSelf();
|
||||
#endif
|
||||
Status = NtOpenThreadToken(NtCurrentThread(),
|
||||
TOKEN_QUERY,
|
||||
TRUE,
|
||||
&TokenHandle);
|
||||
RpcRevertToSelf();
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
ERR("NtOpenThreadToken returns 0x%08lx\n", Status);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
/* Build the new security descriptor */
|
||||
Status = RtlSetSecurityObject(SecurityInformation,
|
||||
|
|
Loading…
Reference in a new issue