6837842: JNI_CreateJavaVM crashes under impersonation

Reviewed-by: acorn, dholmes
This commit is contained in:
Poonam Bajaj 2010-11-19 03:41:50 -08:00
parent 04b08adf06
commit b91e418b3e

View file

@ -889,6 +889,7 @@ static bool add_allow_aces(PSECURITY_DESCRIPTOR pSD,
DWORD newACLsize = aclinfo.AclBytesInUse + DWORD newACLsize = aclinfo.AclBytesInUse +
(sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD)) * ace_count; (sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD)) * ace_count;
for (int i = 0; i < ace_count; i++) { for (int i = 0; i < ace_count; i++) {
assert(aces[i].pSid != 0, "pSid should not be 0");
newACLsize += GetLengthSid(aces[i].pSid); newACLsize += GetLengthSid(aces[i].pSid);
} }
@ -1084,6 +1085,9 @@ static LPSECURITY_ATTRIBUTES make_user_everybody_admin_security_attr(
aces[0].pSid = get_user_sid(GetCurrentProcess()); aces[0].pSid = get_user_sid(GetCurrentProcess());
aces[0].mask = umask; aces[0].mask = umask;
if (aces[0].pSid == 0)
return NULL;
// get the well known SID for BUILTIN\Administrators // get the well known SID for BUILTIN\Administrators
PSID administratorsSid = NULL; PSID administratorsSid = NULL;
SID_IDENTIFIER_AUTHORITY SIDAuthAdministrators = SECURITY_NT_AUTHORITY; SID_IDENTIFIER_AUTHORITY SIDAuthAdministrators = SECURITY_NT_AUTHORITY;