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