mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 12:43:05 +00:00
[SVCHOST] Fix PSID initialization
CORE-17151
This commit is contained in:
parent
37c63770d7
commit
6859348aea
2 changed files with 17 additions and 8 deletions
|
@ -234,7 +234,7 @@ ScDomainIdToSid (
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
ScAllocateAndInitializeSid (
|
ScAllocateAndInitializeSid (
|
||||||
_Out_ PVOID *Sid,
|
_Out_ PSID *Sid,
|
||||||
_In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
|
_In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority,
|
||||||
_In_ ULONG SubAuthorityCount
|
_In_ ULONG SubAuthorityCount
|
||||||
)
|
)
|
||||||
|
@ -274,13 +274,18 @@ ScCreateWellKnownSids (
|
||||||
for (i = 0; i < RTL_NUMBER_OF(SidData); i++)
|
for (i = 0; i < RTL_NUMBER_OF(SidData); i++)
|
||||||
{
|
{
|
||||||
/* Convert our optimized structure into an actual SID */
|
/* Convert our optimized structure into an actual SID */
|
||||||
Status = ScAllocateAndInitializeSid(&SidData[i].Sid,
|
Status = ScAllocateAndInitializeSid(SidData[i].Sid,
|
||||||
&SidData[i].Authority,
|
&SidData[i].Authority,
|
||||||
1);
|
1);
|
||||||
if (!NT_SUCCESS(Status)) break;
|
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DBG_ERR("ScAllocateAndInitializeSid failed for %u\n", i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Write the correct sub-authority */
|
/* Write the correct sub-authority */
|
||||||
*RtlSubAuthoritySid(SidData[i].Sid, 0) = SidData[i].SubAuthority;
|
*RtlSubAuthoritySid(*SidData[i].Sid, 0) = SidData[i].SubAuthority;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now loop the domain SIDs */
|
/* Now loop the domain SIDs */
|
||||||
|
@ -289,8 +294,12 @@ ScCreateWellKnownSids (
|
||||||
/* Convert our optimized structure into an actual SID */
|
/* Convert our optimized structure into an actual SID */
|
||||||
Status = ScDomainIdToSid(BuiltinDomainSid,
|
Status = ScDomainIdToSid(BuiltinDomainSid,
|
||||||
DomainSidData[i].SubAuthority,
|
DomainSidData[i].SubAuthority,
|
||||||
&DomainSidData[i].Sid);
|
DomainSidData[i].Sid);
|
||||||
if (!NT_SUCCESS(Status)) break;
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
DBG_ERR("ScDomainIdToSid failed for %u\n", i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we got to the end, return success */
|
/* If we got to the end, return success */
|
||||||
|
|
|
@ -52,7 +52,7 @@ typedef VOID
|
||||||
//
|
//
|
||||||
typedef struct _DOMAIN_SID_DATA
|
typedef struct _DOMAIN_SID_DATA
|
||||||
{
|
{
|
||||||
PSID Sid;
|
PSID* Sid;
|
||||||
DWORD SubAuthority;
|
DWORD SubAuthority;
|
||||||
} DOMAIN_SID_DATA;
|
} DOMAIN_SID_DATA;
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ typedef struct _DOMAIN_SID_DATA
|
||||||
//
|
//
|
||||||
typedef struct _SID_DATA
|
typedef struct _SID_DATA
|
||||||
{
|
{
|
||||||
PSID Sid;
|
PSID* Sid;
|
||||||
SID_IDENTIFIER_AUTHORITY Authority;
|
SID_IDENTIFIER_AUTHORITY Authority;
|
||||||
DWORD SubAuthority;
|
DWORD SubAuthority;
|
||||||
} SID_DATA;
|
} SID_DATA;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue