From bfa6a6f585a543ce3492d4e0d1ae47236994b6f1 Mon Sep 17 00:00:00 2001 From: Jason Feng Date: Thu, 14 Jan 2021 16:10:45 -0500 Subject: [PATCH] Set domainCombiner from closest frame in result AccessControlContext Set domainCombiner from closest frame in result AccessControlContext of j.s.AccessController.getContextHelper() if the activeDC is null. Signed-off-by: Jason Feng --- .../share/classes/java/security/AccessController.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jcl/src/java.base/share/classes/java/security/AccessController.java b/jcl/src/java.base/share/classes/java/security/AccessController.java index 2831bd0e938..7531db13e98 100644 --- a/jcl/src/java.base/share/classes/java/security/AccessController.java +++ b/jcl/src/java.base/share/classes/java/security/AccessController.java @@ -1,6 +1,6 @@ /*[INCLUDE-IF Sidecar18-SE]*/ /******************************************************************************* - * Copyright (c) 1998, 2019 IBM Corp. and others + * Copyright (c) 1998, 2021 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -510,6 +510,10 @@ private static AccessControlContext getContextHelper(boolean forDoPrivilegedWith } if (null != acc && null != acc.domainCombiner) { accTmp.domainCombiner = acc.domainCombiner; + if (activeDC == null) { + // This activeDC will be set to accContext.domainCombiner. + activeDC = acc.domainCombiner; + } } if (null != domains[j * OBJS_ARRAY_SIZE + OBJS_INDEX_PERMS_OR_CACHECHECKED]) { // this is frame with limited permissions