jaxp/src/com/sun/org/apache/xerces/internal/util/SecurityManager.java
author joehw
Mon, 18 Feb 2013 11:33:35 -0800
changeset 16953 a44e04deb948
parent 12457 c348e06f0e82
child 20975 298d79f9a705
permissions -rw-r--r--
6657673: Issues with JAXP Reviewed-by: alanb, lancea, ahgross, mullan
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * reserved comment block
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 * DO NOT REMOVE OR ALTER!
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
 * The Apache Software License, Version 1.1
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 * Copyright (c) 2003 The Apache Software Foundation.
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 * All rights reserved.
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 * Redistribution and use in source and binary forms, with or without
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 * modification, are permitted provided that the following conditions
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * are met:
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 * 1. Redistributions of source code must retain the above copyright
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 *    notice, this list of conditions and the following disclaimer.
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 * 2. Redistributions in binary form must reproduce the above copyright
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
 *    notice, this list of conditions and the following disclaimer in
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
 *    the documentation and/or other materials provided with the
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
 *    distribution.
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
 * 3. The end-user documentation included with the redistribution,
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
 *    if any, must include the following acknowledgment:
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
 *       "This product includes software developed by the
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
 *        Apache Software Foundation (http://www.apache.org/)."
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
 *    Alternately, this acknowledgment may appear in the software itself,
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
 *    if and wherever such third-party acknowledgments normally appear.
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
 * 4. The names "Xerces" and "Apache Software Foundation" must
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
 *    not be used to endorse or promote products derived from this
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
 *    software without prior written permission. For written
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
 *    permission, please contact apache@apache.org.
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 * 5. Products derived from this software may not be called "Apache",
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 *    nor may "Apache" appear in their name, without prior written
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 *    permission of the Apache Software Foundation.
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
 * SUCH DAMAGE.
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
 * ====================================================================
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
 * This software consists of voluntary contributions made by many
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
 * individuals on behalf of the Apache Software Foundation and was
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
 * originally based on software copyright (c) 1999, International
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
 * Business Machines, Inc., http://www.apache.org.  For more
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
 * information on the Apache Software Foundation, please see
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
 * <http://www.apache.org/>.
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
package com.sun.org.apache.xerces.internal.util;
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
import com.sun.org.apache.xerces.internal.impl.Constants;
16953
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
    64
import java.security.AccessController;
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
    65
import java.security.PrivilegedAction;
6
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
 * This class is a container for parser settings that relate to
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
 * security, or more specifically, it is intended to be used to prevent denial-of-service
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
 * attacks from being launched against a system running Xerces.
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
 * Any component that is aware of a denial-of-service attack that can arise
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
 * from its processing of a certain kind of document may query its Component Manager
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
 * for the property (http://apache.org/xml/properties/security-manager)
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
 * whose value will be an instance of this class.
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
 * If no value has been set for the property, the component should proceed in the "usual" (spec-compliant)
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
 * manner.  If a value has been set, then it must be the case that the component in
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
 * question needs to know what method of this class to query.  This class
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
 * will provide defaults for all known security issues, but will also provide
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
 * setters so that those values can be tailored by applications that care.
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
 * @author  Neil Graham, IBM
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
 *
16953
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
    82
 * @version $Id: SecurityManager.java,v 1.5 2010-11-01 04:40:14 joehw Exp $
6
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
public final class SecurityManager {
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
    //
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
    // Constants
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
    //
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
    // default value for entity expansion limit
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
    private final static int DEFAULT_ENTITY_EXPANSION_LIMIT = 64000;
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
    /** Default value of number of nodes created. **/
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
    private final static int DEFAULT_MAX_OCCUR_NODE_LIMIT = 5000;
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
    //
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
    // Data
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
    //
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
        private final static int DEFAULT_ELEMENT_ATTRIBUTE_LIMIT = 10000;
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
    /** Entity expansion limit. **/
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
    private int entityExpansionLimit;
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
    /** W3C XML Schema maxOccurs limit. **/
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
    private int maxOccurLimit;
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
        private int fElementAttributeLimit;
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
    // default constructor.  Establishes default values for
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
    // all known security holes.
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
     * Default constructor.  Establishes default values
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
     * for known security vulnerabilities.
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
    public SecurityManager() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
        entityExpansionLimit = DEFAULT_ENTITY_EXPANSION_LIMIT;
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
        maxOccurLimit = DEFAULT_MAX_OCCUR_NODE_LIMIT ;
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
                fElementAttributeLimit = DEFAULT_ELEMENT_ATTRIBUTE_LIMIT;
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
                //We are reading system properties only once ,
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
                //at the time of creation of this object ,
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
                readSystemProperties();
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
     * <p>Sets the number of entity expansions that the
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
     * parser should permit in a document.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
     * @param limit the number of entity expansions
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
     * permitted in a document
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
    public void setEntityExpansionLimit(int limit) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
        entityExpansionLimit = limit;
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
     * <p>Returns the number of entity expansions
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
     * that the parser permits in a document.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
     * @return the number of entity expansions
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
     * permitted in a document
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
    public int getEntityExpansionLimit() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
        return entityExpansionLimit;
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
     * <p>Sets the limit of the number of content model nodes
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
     * that may be created when building a grammar for a W3C
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
     * XML Schema that contains maxOccurs attributes with values
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
     * other than "unbounded".</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
     * @param limit the maximum value for maxOccurs other
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
     * than "unbounded"
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
    public void setMaxOccurNodeLimit(int limit){
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
        maxOccurLimit = limit;
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
     * <p>Returns the limit of the number of content model nodes
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
     * that may be created when building a grammar for a W3C
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
     * XML Schema that contains maxOccurs attributes with values
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
     * other than "unbounded".</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
     * @return the maximum value for maxOccurs other
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
     * than "unbounded"
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
    public int getMaxOccurNodeLimit(){
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
        return maxOccurLimit;
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
    public int getElementAttrLimit(){
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
                return fElementAttributeLimit;
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
        public void setElementAttrLimit(int limit){
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
                fElementAttributeLimit = limit;
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
        private void readSystemProperties(){
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
16953
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   182
            //TODO: also read SYSTEM_PROPERTY_ELEMENT_ATTRIBUTE_LIMIT
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   183
            try {
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   184
                    String value = getSystemProperty(Constants.ENTITY_EXPANSION_LIMIT);
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   185
                    if(value != null && !value.equals("")){
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   186
                            entityExpansionLimit = Integer.parseInt(value);
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   187
                            if (entityExpansionLimit < 0)
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   188
                                    entityExpansionLimit = DEFAULT_ENTITY_EXPANSION_LIMIT;
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   189
                    }
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   190
                    else
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   191
                            entityExpansionLimit = DEFAULT_ENTITY_EXPANSION_LIMIT;
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   192
            }catch(Exception ex){}
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   193
16953
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   194
            try {
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   195
                    String value = getSystemProperty(Constants.MAX_OCCUR_LIMIT);
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   196
                    if(value != null && !value.equals("")){
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   197
                            maxOccurLimit = Integer.parseInt(value);
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   198
                            if (maxOccurLimit < 0)
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   199
                                    maxOccurLimit = DEFAULT_MAX_OCCUR_NODE_LIMIT;
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   200
                    }
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   201
                    else
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   202
                            maxOccurLimit = DEFAULT_MAX_OCCUR_NODE_LIMIT;
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   203
            }catch(Exception ex){}
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   204
16953
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   205
            try {
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   206
                    String value = getSystemProperty(Constants.SYSTEM_PROPERTY_ELEMENT_ATTRIBUTE_LIMIT);
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   207
                    if(value != null && !value.equals("")){
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   208
                            fElementAttributeLimit = Integer.parseInt(value);
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   209
                            if ( fElementAttributeLimit < 0)
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   210
                                    fElementAttributeLimit = DEFAULT_ELEMENT_ATTRIBUTE_LIMIT;
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   211
                    }
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   212
                    else
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   213
                            fElementAttributeLimit = DEFAULT_ELEMENT_ATTRIBUTE_LIMIT;
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
7f561c08de6b Initial load
duke
parents:
diff changeset
   215
                }catch(Exception ex){}
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
16953
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   219
    private String getSystemProperty(final String propName) {
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   220
        return AccessController.doPrivileged(new PrivilegedAction<String>() {
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   221
            public String run() {
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   222
                return System.getProperty(propName);
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   223
            }
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   224
        });
a44e04deb948 6657673: Issues with JAXP
joehw
parents: 12457
diff changeset
   225
    }
6
7f561c08de6b Initial load
duke
parents:
diff changeset
   226
} // class SecurityManager