Skip to content

Commit

Permalink
update the code; will squash after testing
Browse files Browse the repository at this point in the history
  • Loading branch information
JinhangZhang committed Jan 29, 2025
1 parent b374b39 commit 5b2181e
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@ public AccessControlContext(ProtectionDomain[] fromContext) {

AccessControlContext(ProtectionDomain[] context, AccessControlContext parentAcc, AccessControlContext acc, int authorizeState) {
super();
boolean contextChanged = false;
switch (authorizeState) {
default:
// authorizeState can't be STATE_UNKNOWN, callerPD is always NULL
Expand All @@ -337,6 +336,7 @@ public AccessControlContext(ProtectionDomain[] fromContext) {
if (parentAcc == null) {
// inherit the domain combiner when authorized
this.domainCombiner = acc.domainCombiner;
this.context = context;
} else {
// when parent combiner is not null, use parent combiner to combine the current context
DomainCombiner parentCombiner = parentAcc.getCombiner();
Expand All @@ -347,24 +347,20 @@ public AccessControlContext(ProtectionDomain[] fromContext) {
this.context = combinePDObjs(context, acc.context);
this.domainCombiner = acc.domainCombiner;
}
contextChanged = true;
}
} else {
if (parentAcc != null) {
this.domainCombiner = parentAcc.domainCombiner;
this.nextStackAcc = parentAcc;
}
this.context = context;
}
break;
case STATE_NOT_AUTHORIZED:
break;
}
if (!contextChanged) {
this.context = context;
break;
}
if (acc != null) {
this.doPrivilegedAcc = acc;
}
this.doPrivilegedAcc = acc;
this.authorizeState = authorizeState;
this.containPrivilegedContext = true;
}
Expand Down

0 comments on commit 5b2181e

Please sign in to comment.