author | coleenp |
Wed, 30 Aug 2017 19:18:22 -0400 | |
changeset 47098 | e704f55561c3 |
parent 45434 | 4582657c7260 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
43803
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
2 |
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package java.security; |
|
27 |
||
30687
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
28 |
import java.lang.ref.Reference; |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
29 |
import java.lang.ref.ReferenceQueue; |
34956
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
30 |
import java.lang.ref.SoftReference; |
27181 | 31 |
import java.lang.ref.WeakReference; |
5183
7825d97c4cf2
6633872: Policy/PolicyFile leak dynamic ProtectionDomains.
mullan
parents:
2
diff
changeset
|
32 |
import java.util.ArrayList; |
2 | 33 |
import java.util.Enumeration; |
34 |
import java.util.List; |
|
42153
d57f354dd0ab
8043252: Debug of access control is obfuscated - NullPointerException in ProtectionDomain
jnimeh
parents:
41596
diff
changeset
|
35 |
import java.util.Objects; |
30687
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
36 |
import java.util.concurrent.ConcurrentHashMap; |
32834
e1dca5fe4de3
8137056: Move SharedSecrets and interface friends out of sun.misc
chegar
parents:
30687
diff
changeset
|
37 |
import jdk.internal.misc.JavaSecurityAccess; |
e1dca5fe4de3
8137056: Move SharedSecrets and interface friends out of sun.misc
chegar
parents:
30687
diff
changeset
|
38 |
import jdk.internal.misc.JavaSecurityProtectionDomainAccess; |
e1dca5fe4de3
8137056: Move SharedSecrets and interface friends out of sun.misc
chegar
parents:
30687
diff
changeset
|
39 |
import static jdk.internal.misc.JavaSecurityProtectionDomainAccess.ProtectionDomainCache; |
e1dca5fe4de3
8137056: Move SharedSecrets and interface friends out of sun.misc
chegar
parents:
30687
diff
changeset
|
40 |
import jdk.internal.misc.SharedSecrets; |
43803
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
41 |
import sun.security.action.GetPropertyAction; |
41377
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
42 |
import sun.security.provider.PolicyFile; |
2 | 43 |
import sun.security.util.Debug; |
41377
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
44 |
import sun.security.util.FilePermCompat; |
2 | 45 |
import sun.security.util.SecurityConstants; |
46 |
||
47 |
/** |
|
30687
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
48 |
* The ProtectionDomain class encapsulates the characteristics of a domain, |
2 | 49 |
* which encloses a set of classes whose instances are granted a set |
50 |
* of permissions when being executed on behalf of a given set of Principals. |
|
51 |
* <p> |
|
52 |
* A static set of permissions can be bound to a ProtectionDomain when it is |
|
53 |
* constructed; such permissions are granted to the domain regardless of the |
|
54 |
* Policy in force. However, to support dynamic security policies, a |
|
55 |
* ProtectionDomain can also be constructed such that it is dynamically |
|
56 |
* mapped to a set of permissions by the current Policy whenever a permission |
|
57 |
* is checked. |
|
58 |
* |
|
59 |
* @author Li Gong |
|
60 |
* @author Roland Schemers |
|
61 |
* @author Gary Ellison |
|
45434
4582657c7260
8181082: class-level since tag issues in java.base & java.datatransfer module
mli
parents:
43803
diff
changeset
|
62 |
* @since 1.2 |
2 | 63 |
*/ |
64 |
||
65 |
public class ProtectionDomain { |
|
30687
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
66 |
|
43803
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
67 |
/** |
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
68 |
* If true, {@link #impliesWithAltFilePerm} will try to be compatible on |
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
69 |
* FilePermission checking even if a 3rd-party Policy implementation is set. |
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
70 |
*/ |
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
71 |
private static final boolean filePermCompatInPD = |
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
72 |
"true".equals(GetPropertyAction.privilegedGetProperty( |
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
73 |
"jdk.security.filePermCompat")); |
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
74 |
|
29027
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
75 |
private static class JavaSecurityAccessImpl implements JavaSecurityAccess { |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
76 |
|
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
77 |
private JavaSecurityAccessImpl() { |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
78 |
} |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
79 |
|
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
80 |
@Override |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
81 |
public <T> T doIntersectionPrivilege( |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
82 |
PrivilegedAction<T> action, |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
83 |
final AccessControlContext stack, |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
84 |
final AccessControlContext context) { |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
85 |
if (action == null) { |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
86 |
throw new NullPointerException(); |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
87 |
} |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
88 |
|
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
89 |
return AccessController.doPrivileged( |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
90 |
action, |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
91 |
getCombinedACC(context, stack) |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
92 |
); |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
93 |
} |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
94 |
|
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
95 |
@Override |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
96 |
public <T> T doIntersectionPrivilege( |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
97 |
PrivilegedAction<T> action, |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
98 |
AccessControlContext context) { |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
99 |
return doIntersectionPrivilege(action, |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
100 |
AccessController.getContext(), context); |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
101 |
} |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
102 |
|
41596
a6382b6ba29d
8165271: Fix use of reflection to gain access to private fields
ddehaven
parents:
41377
diff
changeset
|
103 |
@Override |
a6382b6ba29d
8165271: Fix use of reflection to gain access to private fields
ddehaven
parents:
41377
diff
changeset
|
104 |
public ProtectionDomain[] getProtectDomains(AccessControlContext context) { |
a6382b6ba29d
8165271: Fix use of reflection to gain access to private fields
ddehaven
parents:
41377
diff
changeset
|
105 |
return context.getContext(); |
a6382b6ba29d
8165271: Fix use of reflection to gain access to private fields
ddehaven
parents:
41377
diff
changeset
|
106 |
} |
a6382b6ba29d
8165271: Fix use of reflection to gain access to private fields
ddehaven
parents:
41377
diff
changeset
|
107 |
|
30687
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
108 |
private static AccessControlContext getCombinedACC( |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
109 |
AccessControlContext context, AccessControlContext stack) { |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
110 |
AccessControlContext acc = |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
111 |
new AccessControlContext(context, stack.getCombiner(), true); |
29027
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
112 |
|
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
113 |
return new AccessControlContext(stack.getContext(), acc).optimize(); |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
114 |
} |
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
115 |
} |
2 | 116 |
|
8816
29f983feda95
6907662: System clipboard should ensure access restrictions
denis
parents:
7970
diff
changeset
|
117 |
static { |
30687
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
118 |
// setup SharedSecrets to allow access to doIntersectionPrivilege |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
119 |
// methods and ProtectionDomain cache |
29027
2df5737b2c8a
8064331: JavaSecurityAccess.doIntersectionPrivilege() drops the information about the domain combiner of the stack ACC
jbachorik
parents:
27181
diff
changeset
|
120 |
SharedSecrets.setJavaSecurityAccess(new JavaSecurityAccessImpl()); |
30687
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
121 |
SharedSecrets.setJavaSecurityProtectionDomainAccess( |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
122 |
new JavaSecurityProtectionDomainAccess() { |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
123 |
@Override |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
124 |
public ProtectionDomainCache getProtectionDomainCache() { |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
125 |
return new PDCache(); |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
126 |
} |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
127 |
}); |
8816
29f983feda95
6907662: System clipboard should ensure access restrictions
denis
parents:
7970
diff
changeset
|
128 |
} |
29f983feda95
6907662: System clipboard should ensure access restrictions
denis
parents:
7970
diff
changeset
|
129 |
|
30687
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
130 |
/** |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
131 |
* Used for storing ProtectionDomains as keys in a Map. |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
132 |
*/ |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
133 |
static final class Key {} |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
134 |
|
2 | 135 |
/* CodeSource */ |
136 |
private CodeSource codesource ; |
|
137 |
||
138 |
/* ClassLoader the protection domain was consed from */ |
|
139 |
private ClassLoader classloader; |
|
140 |
||
141 |
/* Principals running-as within this protection domain */ |
|
142 |
private Principal[] principals; |
|
143 |
||
144 |
/* the rights this protection domain is granted */ |
|
145 |
private PermissionCollection permissions; |
|
146 |
||
147 |
/* if the permissions object has AllPermission */ |
|
148 |
private boolean hasAllPerm = false; |
|
149 |
||
150 |
/* the PermissionCollection is static (pre 1.4 constructor) |
|
151 |
or dynamic (via a policy refresh) */ |
|
39747
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
152 |
private final boolean staticPermissions; |
2 | 153 |
|
5183
7825d97c4cf2
6633872: Policy/PolicyFile leak dynamic ProtectionDomains.
mullan
parents:
2
diff
changeset
|
154 |
/* |
7825d97c4cf2
6633872: Policy/PolicyFile leak dynamic ProtectionDomains.
mullan
parents:
2
diff
changeset
|
155 |
* An object used as a key when the ProtectionDomain is stored in a Map. |
7825d97c4cf2
6633872: Policy/PolicyFile leak dynamic ProtectionDomains.
mullan
parents:
2
diff
changeset
|
156 |
*/ |
7825d97c4cf2
6633872: Policy/PolicyFile leak dynamic ProtectionDomains.
mullan
parents:
2
diff
changeset
|
157 |
final Key key = new Key(); |
7825d97c4cf2
6633872: Policy/PolicyFile leak dynamic ProtectionDomains.
mullan
parents:
2
diff
changeset
|
158 |
|
2 | 159 |
/** |
160 |
* Creates a new ProtectionDomain with the given CodeSource and |
|
161 |
* Permissions. If the permissions object is not null, then |
|
37880 | 162 |
* {@code setReadOnly()} will be called on the passed in |
39747
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
163 |
* Permissions object. |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
164 |
* <p> |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
165 |
* The permissions granted to this domain are static, i.e. |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
166 |
* invoking the {@link #staticPermissionsOnly()} method returns true. |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
167 |
* They contain only the ones passed to this constructor and |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
168 |
* the current Policy will not be consulted. |
2 | 169 |
* |
170 |
* @param codesource the codesource associated with this domain |
|
171 |
* @param permissions the permissions granted to this domain |
|
172 |
*/ |
|
173 |
public ProtectionDomain(CodeSource codesource, |
|
174 |
PermissionCollection permissions) { |
|
175 |
this.codesource = codesource; |
|
176 |
if (permissions != null) { |
|
177 |
this.permissions = permissions; |
|
178 |
this.permissions.setReadOnly(); |
|
179 |
if (permissions instanceof Permissions && |
|
180 |
((Permissions)permissions).allPermission != null) { |
|
181 |
hasAllPerm = true; |
|
182 |
} |
|
183 |
} |
|
184 |
this.classloader = null; |
|
185 |
this.principals = new Principal[0]; |
|
186 |
staticPermissions = true; |
|
187 |
} |
|
188 |
||
189 |
/** |
|
190 |
* Creates a new ProtectionDomain qualified by the given CodeSource, |
|
191 |
* Permissions, ClassLoader and array of Principals. If the |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
18222
diff
changeset
|
192 |
* permissions object is not null, then {@code setReadOnly()} |
2 | 193 |
* will be called on the passed in Permissions object. |
39747
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
194 |
* <p> |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
195 |
* The permissions granted to this domain are dynamic, i.e. |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
196 |
* invoking the {@link #staticPermissionsOnly()} method returns false. |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
197 |
* They include both the static permissions passed to this constructor, |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
198 |
* and any permissions granted to this domain by the current Policy at the |
2 | 199 |
* time a permission is checked. |
200 |
* <p> |
|
201 |
* This constructor is typically used by |
|
202 |
* {@link SecureClassLoader ClassLoaders} |
|
203 |
* and {@link DomainCombiner DomainCombiners} which delegate to |
|
18579
b678846778ad
8019360: Cleanup of the javadoc <code> tag in java.security.*
juh
parents:
18222
diff
changeset
|
204 |
* {@code Policy} to actively associate the permissions granted to |
2 | 205 |
* this domain. This constructor affords the |
206 |
* Policy provider the opportunity to augment the supplied |
|
207 |
* PermissionCollection to reflect policy changes. |
|
208 |
* |
|
209 |
* @param codesource the CodeSource associated with this domain |
|
210 |
* @param permissions the permissions granted to this domain |
|
211 |
* @param classloader the ClassLoader associated with this domain |
|
212 |
* @param principals the array of Principals associated with this |
|
213 |
* domain. The contents of the array are copied to protect against |
|
214 |
* subsequent modification. |
|
215 |
* @see Policy#refresh |
|
216 |
* @see Policy#getPermissions(ProtectionDomain) |
|
217 |
* @since 1.4 |
|
218 |
*/ |
|
219 |
public ProtectionDomain(CodeSource codesource, |
|
220 |
PermissionCollection permissions, |
|
221 |
ClassLoader classloader, |
|
222 |
Principal[] principals) { |
|
223 |
this.codesource = codesource; |
|
224 |
if (permissions != null) { |
|
225 |
this.permissions = permissions; |
|
226 |
this.permissions.setReadOnly(); |
|
227 |
if (permissions instanceof Permissions && |
|
228 |
((Permissions)permissions).allPermission != null) { |
|
229 |
hasAllPerm = true; |
|
230 |
} |
|
231 |
} |
|
232 |
this.classloader = classloader; |
|
233 |
this.principals = (principals != null ? principals.clone(): |
|
234 |
new Principal[0]); |
|
235 |
staticPermissions = false; |
|
236 |
} |
|
237 |
||
238 |
/** |
|
239 |
* Returns the CodeSource of this domain. |
|
240 |
* @return the CodeSource of this domain which may be null. |
|
241 |
* @since 1.2 |
|
242 |
*/ |
|
243 |
public final CodeSource getCodeSource() { |
|
244 |
return this.codesource; |
|
245 |
} |
|
246 |
||
247 |
||
248 |
/** |
|
249 |
* Returns the ClassLoader of this domain. |
|
250 |
* @return the ClassLoader of this domain which may be null. |
|
251 |
* |
|
252 |
* @since 1.4 |
|
253 |
*/ |
|
254 |
public final ClassLoader getClassLoader() { |
|
255 |
return this.classloader; |
|
256 |
} |
|
257 |
||
258 |
||
259 |
/** |
|
260 |
* Returns an array of principals for this domain. |
|
261 |
* @return a non-null array of principals for this domain. |
|
262 |
* Returns a new array each time this method is called. |
|
263 |
* |
|
264 |
* @since 1.4 |
|
265 |
*/ |
|
266 |
public final Principal[] getPrincipals() { |
|
267 |
return this.principals.clone(); |
|
268 |
} |
|
269 |
||
270 |
/** |
|
271 |
* Returns the static permissions granted to this domain. |
|
272 |
* |
|
273 |
* @return the static set of permissions for this domain which may be null. |
|
274 |
* @see Policy#refresh |
|
275 |
* @see Policy#getPermissions(ProtectionDomain) |
|
276 |
*/ |
|
277 |
public final PermissionCollection getPermissions() { |
|
278 |
return permissions; |
|
279 |
} |
|
280 |
||
281 |
/** |
|
39747
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
282 |
* Returns true if this domain contains only static permissions |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
283 |
* and does not check the current {@code Policy} at the time of |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
284 |
* permission checking. |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
285 |
* |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
286 |
* @return true if this domain contains only static permissions. |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
287 |
* |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
288 |
* @since 9 |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
289 |
*/ |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
290 |
public final boolean staticPermissionsOnly() { |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
291 |
return this.staticPermissions; |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
292 |
} |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
293 |
|
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
294 |
/** |
2 | 295 |
* Check and see if this ProtectionDomain implies the permissions |
296 |
* expressed in the Permission object. |
|
297 |
* <p> |
|
298 |
* The set of permissions evaluated is a function of whether the |
|
299 |
* ProtectionDomain was constructed with a static set of permissions |
|
300 |
* or it was bound to a dynamically mapped set of permissions. |
|
301 |
* <p> |
|
39747
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
302 |
* If the {@link #staticPermissionsOnly()} method returns |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
303 |
* true, then the permission will only be checked against the |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
304 |
* PermissionCollection supplied at construction. |
2 | 305 |
* <p> |
39747
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
306 |
* Otherwise, the permission will be checked against the combination |
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
307 |
* of the PermissionCollection supplied at construction and |
2 | 308 |
* the current Policy binding. |
309 |
* |
|
39747
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
310 |
* @param perm the Permission object to check. |
2 | 311 |
* |
39747
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
312 |
* @return true if {@code perm} is implied by this ProtectionDomain. |
2 | 313 |
*/ |
39747
2d542b973871
8138811: Construction of static protection domains
valeriep
parents:
37882
diff
changeset
|
314 |
public boolean implies(Permission perm) { |
2 | 315 |
|
316 |
if (hasAllPerm) { |
|
317 |
// internal permission collection already has AllPermission - |
|
318 |
// no need to go to policy |
|
319 |
return true; |
|
320 |
} |
|
321 |
||
322 |
if (!staticPermissions && |
|
41377
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
323 |
Policy.getPolicyNoCheck().implies(this, perm)) { |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
324 |
return true; |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
325 |
} |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
326 |
if (permissions != null) { |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
327 |
return permissions.implies(perm); |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
328 |
} |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
329 |
|
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
330 |
return false; |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
331 |
} |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
332 |
|
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
333 |
/** |
43803
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
334 |
* This method has almost the same logic flow as {@link #implies} but |
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
335 |
* it ensures some level of FilePermission compatibility after JDK-8164705. |
41377
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
336 |
* |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
337 |
* This method is called by {@link AccessControlContext#checkPermission} |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
338 |
* and not intended to be called by an application. |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
339 |
*/ |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
340 |
boolean impliesWithAltFilePerm(Permission perm) { |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
341 |
|
43803
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
342 |
// If FilePermCompat.compat is set (default value), FilePermission |
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
343 |
// checking compatibility should be considered. |
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
344 |
|
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
345 |
// If filePermCompatInPD is set, this method checks for alternative |
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
346 |
// FilePermission to keep compatibility for any Policy implementation. |
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
347 |
// When set to false (default value), implies() is called since |
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
348 |
// the PolicyFile implementation already supports compatibility. |
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
349 |
|
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
350 |
// If this is a subclass of ProtectionDomain, call implies() |
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
351 |
// because most likely user has overridden it. |
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
352 |
|
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
353 |
if (!filePermCompatInPD || !FilePermCompat.compat || |
e1881d258206
8168410: Multiple JCK tests are failing due to SecurityException is not thrown.
weijun
parents:
42153
diff
changeset
|
354 |
getClass() != ProtectionDomain.class) { |
41377
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
355 |
return implies(perm); |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
356 |
} |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
357 |
|
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
358 |
if (hasAllPerm) { |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
359 |
// internal permission collection already has AllPermission - |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
360 |
// no need to go to policy |
2 | 361 |
return true; |
41377
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
362 |
} |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
363 |
|
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
364 |
Permission p2 = null; |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
365 |
boolean p2Calculated = false; |
2 | 366 |
|
41377
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
367 |
if (!staticPermissions) { |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
368 |
Policy policy = Policy.getPolicyNoCheck(); |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
369 |
if (policy instanceof PolicyFile) { |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
370 |
// The PolicyFile implementation supports compatibility |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
371 |
// inside and it also covers the static permissions. |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
372 |
return policy.implies(this, perm); |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
373 |
} else { |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
374 |
if (policy.implies(this, perm)) { |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
375 |
return true; |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
376 |
} |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
377 |
p2 = FilePermCompat.newPermUsingAltPath(perm); |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
378 |
p2Calculated = true; |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
379 |
if (p2 != null && policy.implies(this, p2)) { |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
380 |
return true; |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
381 |
} |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
382 |
} |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
383 |
} |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
384 |
if (permissions != null) { |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
385 |
if (permissions.implies(perm)) { |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
386 |
return true; |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
387 |
} else { |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
388 |
if (!p2Calculated) { |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
389 |
p2 = FilePermCompat.newPermUsingAltPath(perm); |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
390 |
} |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
391 |
if (p2 != null) { |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
392 |
return permissions.implies(p2); |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
393 |
} |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
394 |
} |
271ee055cb31
8164705: Remove pathname canonicalization from FilePermission
weijun
parents:
39747
diff
changeset
|
395 |
} |
2 | 396 |
return false; |
397 |
} |
|
398 |
||
18222 | 399 |
// called by the VM -- do not remove |
400 |
boolean impliesCreateAccessControlContext() { |
|
401 |
return implies(SecurityConstants.CREATE_ACC_PERMISSION); |
|
402 |
} |
|
403 |
||
2 | 404 |
/** |
405 |
* Convert a ProtectionDomain to a String. |
|
406 |
*/ |
|
5183
7825d97c4cf2
6633872: Policy/PolicyFile leak dynamic ProtectionDomains.
mullan
parents:
2
diff
changeset
|
407 |
@Override public String toString() { |
2 | 408 |
String pals = "<no principals>"; |
409 |
if (principals != null && principals.length > 0) { |
|
410 |
StringBuilder palBuf = new StringBuilder("(principals "); |
|
411 |
||
412 |
for (int i = 0; i < principals.length; i++) { |
|
413 |
palBuf.append(principals[i].getClass().getName() + |
|
414 |
" \"" + principals[i].getName() + |
|
415 |
"\""); |
|
416 |
if (i < principals.length-1) |
|
417 |
palBuf.append(",\n"); |
|
418 |
else |
|
419 |
palBuf.append(")\n"); |
|
420 |
} |
|
421 |
pals = palBuf.toString(); |
|
422 |
} |
|
423 |
||
424 |
// Check if policy is set; we don't want to load |
|
425 |
// the policy prematurely here |
|
426 |
PermissionCollection pc = Policy.isSet() && seeAllp() ? |
|
427 |
mergePermissions(): |
|
428 |
getPermissions(); |
|
429 |
||
430 |
return "ProtectionDomain "+ |
|
431 |
" "+codesource+"\n"+ |
|
432 |
" "+classloader+"\n"+ |
|
433 |
" "+pals+"\n"+ |
|
434 |
" "+pc+"\n"; |
|
435 |
} |
|
436 |
||
37882
e7f3cf12e739
6328855: String: Matches hangs at short and easy Strings containing \r \n
sherman
parents:
37880
diff
changeset
|
437 |
/* |
e7f3cf12e739
6328855: String: Matches hangs at short and easy Strings containing \r \n
sherman
parents:
37880
diff
changeset
|
438 |
* holder class for the static field "debug" to delay its initialization |
e7f3cf12e739
6328855: String: Matches hangs at short and easy Strings containing \r \n
sherman
parents:
37880
diff
changeset
|
439 |
*/ |
e7f3cf12e739
6328855: String: Matches hangs at short and easy Strings containing \r \n
sherman
parents:
37880
diff
changeset
|
440 |
private static class DebugHolder { |
e7f3cf12e739
6328855: String: Matches hangs at short and easy Strings containing \r \n
sherman
parents:
37880
diff
changeset
|
441 |
private static final Debug debug = Debug.getInstance("domain"); |
e7f3cf12e739
6328855: String: Matches hangs at short and easy Strings containing \r \n
sherman
parents:
37880
diff
changeset
|
442 |
} |
e7f3cf12e739
6328855: String: Matches hangs at short and easy Strings containing \r \n
sherman
parents:
37880
diff
changeset
|
443 |
|
2 | 444 |
/** |
445 |
* Return true (merge policy permissions) in the following cases: |
|
446 |
* |
|
447 |
* . SecurityManager is null |
|
448 |
* |
|
449 |
* . SecurityManager is not null, |
|
450 |
* debug is not null, |
|
451 |
* SecurityManager impelmentation is in bootclasspath, |
|
452 |
* Policy implementation is in bootclasspath |
|
453 |
* (the bootclasspath restrictions avoid recursion) |
|
454 |
* |
|
455 |
* . SecurityManager is not null, |
|
456 |
* debug is null, |
|
457 |
* caller has Policy.getPolicy permission |
|
458 |
*/ |
|
459 |
private static boolean seeAllp() { |
|
460 |
SecurityManager sm = System.getSecurityManager(); |
|
461 |
||
462 |
if (sm == null) { |
|
463 |
return true; |
|
464 |
} else { |
|
37882
e7f3cf12e739
6328855: String: Matches hangs at short and easy Strings containing \r \n
sherman
parents:
37880
diff
changeset
|
465 |
if (DebugHolder.debug != null) { |
2 | 466 |
if (sm.getClass().getClassLoader() == null && |
467 |
Policy.getPolicyNoCheck().getClass().getClassLoader() |
|
468 |
== null) { |
|
469 |
return true; |
|
470 |
} |
|
471 |
} else { |
|
472 |
try { |
|
473 |
sm.checkPermission(SecurityConstants.GET_POLICY_PERMISSION); |
|
474 |
return true; |
|
475 |
} catch (SecurityException se) { |
|
476 |
// fall thru and return false |
|
477 |
} |
|
478 |
} |
|
479 |
} |
|
480 |
||
481 |
return false; |
|
482 |
} |
|
483 |
||
484 |
private PermissionCollection mergePermissions() { |
|
485 |
if (staticPermissions) |
|
486 |
return permissions; |
|
487 |
||
488 |
PermissionCollection perms = |
|
489 |
java.security.AccessController.doPrivileged |
|
30033
b9c86c17164a
8078468: Update security libraries to use diamond with anonymous classes
darcy
parents:
29492
diff
changeset
|
490 |
(new java.security.PrivilegedAction<>() { |
2 | 491 |
public PermissionCollection run() { |
492 |
Policy p = Policy.getPolicyNoCheck(); |
|
493 |
return p.getPermissions(ProtectionDomain.this); |
|
494 |
} |
|
495 |
}); |
|
496 |
||
497 |
Permissions mergedPerms = new Permissions(); |
|
498 |
int swag = 32; |
|
499 |
int vcap = 8; |
|
500 |
Enumeration<Permission> e; |
|
7970
af1579474d16
7008728: diamond conversion of basic security, permissions, authentication
smarks
parents:
5506
diff
changeset
|
501 |
List<Permission> pdVector = new ArrayList<>(vcap); |
af1579474d16
7008728: diamond conversion of basic security, permissions, authentication
smarks
parents:
5506
diff
changeset
|
502 |
List<Permission> plVector = new ArrayList<>(swag); |
2 | 503 |
|
504 |
// |
|
505 |
// Build a vector of domain permissions for subsequent merge |
|
506 |
if (permissions != null) { |
|
507 |
synchronized (permissions) { |
|
508 |
e = permissions.elements(); |
|
509 |
while (e.hasMoreElements()) { |
|
510 |
pdVector.add(e.nextElement()); |
|
511 |
} |
|
512 |
} |
|
513 |
} |
|
514 |
||
515 |
// |
|
516 |
// Build a vector of Policy permissions for subsequent merge |
|
517 |
if (perms != null) { |
|
518 |
synchronized (perms) { |
|
519 |
e = perms.elements(); |
|
520 |
while (e.hasMoreElements()) { |
|
521 |
plVector.add(e.nextElement()); |
|
522 |
vcap++; |
|
523 |
} |
|
524 |
} |
|
525 |
} |
|
526 |
||
527 |
if (perms != null && permissions != null) { |
|
528 |
// |
|
529 |
// Weed out the duplicates from the policy. Unless a refresh |
|
21278 | 530 |
// has occurred since the pd was consed this should result in |
2 | 531 |
// an empty vector. |
532 |
synchronized (permissions) { |
|
533 |
e = permissions.elements(); // domain vs policy |
|
534 |
while (e.hasMoreElements()) { |
|
535 |
Permission pdp = e.nextElement(); |
|
10336
0bb1999251f8
7064075: Security libraries don't build with javac -Xlint:all,-deprecation -Werror
jjg
parents:
9035
diff
changeset
|
536 |
Class<?> pdpClass = pdp.getClass(); |
2 | 537 |
String pdpActions = pdp.getActions(); |
538 |
String pdpName = pdp.getName(); |
|
539 |
for (int i = 0; i < plVector.size(); i++) { |
|
540 |
Permission pp = plVector.get(i); |
|
541 |
if (pdpClass.isInstance(pp)) { |
|
542 |
// The equals() method on some permissions |
|
543 |
// have some side effects so this manual |
|
544 |
// comparison is sufficient. |
|
545 |
if (pdpName.equals(pp.getName()) && |
|
42153
d57f354dd0ab
8043252: Debug of access control is obfuscated - NullPointerException in ProtectionDomain
jnimeh
parents:
41596
diff
changeset
|
546 |
Objects.equals(pdpActions, pp.getActions())) { |
2 | 547 |
plVector.remove(i); |
548 |
break; |
|
549 |
} |
|
550 |
} |
|
551 |
} |
|
552 |
} |
|
553 |
} |
|
554 |
} |
|
555 |
||
556 |
if (perms !=null) { |
|
557 |
// the order of adding to merged perms and permissions |
|
558 |
// needs to preserve the bugfix 4301064 |
|
559 |
||
560 |
for (int i = plVector.size()-1; i >= 0; i--) { |
|
561 |
mergedPerms.add(plVector.get(i)); |
|
562 |
} |
|
563 |
} |
|
564 |
if (permissions != null) { |
|
565 |
for (int i = pdVector.size()-1; i >= 0; i--) { |
|
566 |
mergedPerms.add(pdVector.get(i)); |
|
567 |
} |
|
568 |
} |
|
569 |
||
570 |
return mergedPerms; |
|
571 |
} |
|
5183
7825d97c4cf2
6633872: Policy/PolicyFile leak dynamic ProtectionDomains.
mullan
parents:
2
diff
changeset
|
572 |
|
7825d97c4cf2
6633872: Policy/PolicyFile leak dynamic ProtectionDomains.
mullan
parents:
2
diff
changeset
|
573 |
/** |
30687
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
574 |
* A cache of ProtectionDomains and their Permissions. |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
575 |
* |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
576 |
* This class stores ProtectionDomains as weak keys in a ConcurrentHashMap |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
577 |
* with additional support for checking and removing weak keys that are no |
34956
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
578 |
* longer in use. There can be cases where the permission collection may |
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
579 |
* have a chain of strong references back to the ProtectionDomain, which |
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
580 |
* ordinarily would prevent the entry from being removed from the map. To |
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
581 |
* address that, we wrap the permission collection in a SoftReference so |
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
582 |
* that it can be reclaimed by the garbage collector due to memory demand. |
5183
7825d97c4cf2
6633872: Policy/PolicyFile leak dynamic ProtectionDomains.
mullan
parents:
2
diff
changeset
|
583 |
*/ |
27181 | 584 |
private static class PDCache implements ProtectionDomainCache { |
30687
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
585 |
private final ConcurrentHashMap<WeakProtectionDomainKey, |
34956
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
586 |
SoftReference<PermissionCollection>> |
30687
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
587 |
pdMap = new ConcurrentHashMap<>(); |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
588 |
private final ReferenceQueue<Key> queue = new ReferenceQueue<>(); |
27181 | 589 |
|
590 |
@Override |
|
30687
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
591 |
public void put(ProtectionDomain pd, PermissionCollection pc) { |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
592 |
processQueue(queue, pdMap); |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
593 |
WeakProtectionDomainKey weakPd = |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
594 |
new WeakProtectionDomainKey(pd, queue); |
34956
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
595 |
pdMap.put(weakPd, new SoftReference<>(pc)); |
27181 | 596 |
} |
597 |
||
598 |
@Override |
|
30687
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
599 |
public PermissionCollection get(ProtectionDomain pd) { |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
600 |
processQueue(queue, pdMap); |
34956
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
601 |
WeakProtectionDomainKey weakPd = new WeakProtectionDomainKey(pd); |
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
602 |
SoftReference<PermissionCollection> sr = pdMap.get(weakPd); |
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
603 |
return (sr == null) ? null : sr.get(); |
30687
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
604 |
} |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
605 |
|
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
606 |
/** |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
607 |
* Removes weak keys from the map that have been enqueued |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
608 |
* on the reference queue and are no longer in use. |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
609 |
*/ |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
610 |
private static void processQueue(ReferenceQueue<Key> queue, |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
611 |
ConcurrentHashMap<? extends |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
612 |
WeakReference<Key>, ?> pdMap) { |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
613 |
Reference<? extends Key> ref; |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
614 |
while ((ref = queue.poll()) != null) { |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
615 |
pdMap.remove(ref); |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
616 |
} |
27181 | 617 |
} |
618 |
} |
|
5183
7825d97c4cf2
6633872: Policy/PolicyFile leak dynamic ProtectionDomains.
mullan
parents:
2
diff
changeset
|
619 |
|
30687
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
620 |
/** |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
621 |
* A weak key for a ProtectionDomain. |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
622 |
*/ |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
623 |
private static class WeakProtectionDomainKey extends WeakReference<Key> { |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
624 |
/** |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
625 |
* Saved value of the referent's identity hash code, to maintain |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
626 |
* a consistent hash code after the referent has been cleared |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
627 |
*/ |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
628 |
private final int hash; |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
629 |
|
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
630 |
/** |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
631 |
* A key representing a null ProtectionDomain. |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
632 |
*/ |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
633 |
private static final Key NULL_KEY = new Key(); |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
634 |
|
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
635 |
/** |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
636 |
* Create a new WeakProtectionDomain with the specified domain and |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
637 |
* registered with a queue. |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
638 |
*/ |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
639 |
WeakProtectionDomainKey(ProtectionDomain pd, ReferenceQueue<Key> rq) { |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
640 |
this((pd == null ? NULL_KEY : pd.key), rq); |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
641 |
} |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
642 |
|
34956
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
643 |
WeakProtectionDomainKey(ProtectionDomain pd) { |
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
644 |
this(pd == null ? NULL_KEY : pd.key); |
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
645 |
} |
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
646 |
|
30687
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
647 |
private WeakProtectionDomainKey(Key key, ReferenceQueue<Key> rq) { |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
648 |
super(key, rq); |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
649 |
hash = key.hashCode(); |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
650 |
} |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
651 |
|
34956
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
652 |
private WeakProtectionDomainKey(Key key) { |
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
653 |
super(key); |
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
654 |
hash = key.hashCode(); |
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
655 |
} |
cfa4105ed600
8085903: New fix for memory leak in ProtectionDomain cache
mullan
parents:
32834
diff
changeset
|
656 |
|
30687
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
657 |
/** |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
658 |
* Returns the identity hash code of the original referent. |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
659 |
*/ |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
660 |
@Override |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
661 |
public int hashCode() { |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
662 |
return hash; |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
663 |
} |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
664 |
|
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
665 |
/** |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
666 |
* Returns true if the given object is an identical |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
667 |
* WeakProtectionDomainKey instance, or, if this object's referent |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
668 |
* has not been cleared and the given object is another |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
669 |
* WeakProtectionDomainKey instance with an identical non-null |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
670 |
* referent as this one. |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
671 |
*/ |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
672 |
@Override |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
673 |
public boolean equals(Object obj) { |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
674 |
if (obj == this) { |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
675 |
return true; |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
676 |
} |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
677 |
|
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
678 |
if (obj instanceof WeakProtectionDomainKey) { |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
679 |
Object referent = get(); |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
680 |
return (referent != null) && |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
681 |
(referent == ((WeakProtectionDomainKey)obj).get()); |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
682 |
} else { |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
683 |
return false; |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
684 |
} |
eb40445ce6d7
8055753: Use ConcurrentHashMap to map ProtectionDomain to PermissionCollection
mullan
parents:
30033
diff
changeset
|
685 |
} |
5183
7825d97c4cf2
6633872: Policy/PolicyFile leak dynamic ProtectionDomains.
mullan
parents:
2
diff
changeset
|
686 |
} |
2 | 687 |
} |