Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set domainCombiner from closest frame in result AccessControlContext #3051

Merged
merged 1 commit into from
Sep 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ private static AccessControlContext getContextHelper(boolean forDoPrivilegedWith
int frameNbr = domains.length / OBJS_ARRAY_SIZE;
AccessControlContext accContext = null;
AccessControlContext accLower = null;
DomainCombiner dc = null; // store a non-null domainCombiner from a closest frame or null
for (int j = 0; j < frameNbr; ++j) {
AccessControlContext acc = (AccessControlContext) domains[j * OBJS_ARRAY_SIZE];
/*[PR JAZZ 66930] j.s.AccessControlContext.checkPermission() invoke untrusted ProtectionDomain.implies */
Expand All @@ -486,6 +487,10 @@ private static AccessControlContext getContextHelper(boolean forDoPrivilegedWith
}
if (null != acc && null != acc.domainCombiner) {
accTmp.domainCombiner = acc.domainCombiner;
JasonFengJ9 marked this conversation as resolved.
Show resolved Hide resolved
if (dc == null) {
// this dc will be set to accContext.domainCombiner
dc = acc.domainCombiner;
}
}
if (null != domains[j * OBJS_ARRAY_SIZE + OBJS_INDEX_PERMS_OR_CACHECHECKED]) {
// this is frame with limited permissions
Expand All @@ -500,7 +505,9 @@ private static AccessControlContext getContextHelper(boolean forDoPrivilegedWith
}
accLower = accTmp;
}

if ((accContext != null) && (accContext.domainCombiner == null) && (dc != null)) {
accContext.domainCombiner = dc;
JasonFengJ9 marked this conversation as resolved.
Show resolved Hide resolved
}
return accContext;
}

Expand Down