Path: blob/aarch64-shenandoah-jdk8u272-b10/jaxws/src/share/jaxws_classes/javax/xml/bind/JAXBPermission.java
38890 views
/*1* Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.xml.bind;2627import java.security.BasicPermission;2829/**30* This class is for JAXB permissions. A {@code JAXBPermission}31* contains a name (also referred to as a "target name") but32* no actions list; you either have the named permission33* or you don't.34*35* <P>36* The target name is the name of the JAXB permission (see below).37*38* <P>39* The following table lists all the possible {@code JAXBPermission} target names,40* and for each provides a description of what the permission allows41* and a discussion of the risks of granting code the permission.42* <P>43*44* <table border=1 cellpadding=5 summary="Permission target name, what the permission allows, and associated risks">45* <tr>46* <th>Permission Target Name</th>47* <th>What the Permission Allows</th>48* <th>Risks of Allowing this Permission</th>49* </tr>50*51* <tr>52* <td>setDatatypeConverter</td>53* <td>54* Allows the code to set VM-wide {@link DatatypeConverterInterface}55* via {@link DatatypeConverter#setDatatypeConverter(DatatypeConverterInterface) the setDatatypeConverter method}56* that all the methods on {@link DatatypeConverter} uses.57* </td>58* <td>59* Malicious code can set {@link DatatypeConverterInterface}, which has60* VM-wide singleton semantics, before a genuine JAXB implementation sets one.61* This allows malicious code to gain access to objects that it may otherwise62* not have access to, such as {@link java.awt.Frame#getFrames()} that belongs to63* another application running in the same JVM.64* </td>65* </tr>66* </table>67*68* @see java.security.BasicPermission69* @see java.security.Permission70* @see java.security.Permissions71* @see java.security.PermissionCollection72* @see java.lang.SecurityManager73*74* @author Joe Fialli75* @since JAXB 2.276*/7778/* code was borrowed originally from java.lang.RuntimePermission. */79public final class JAXBPermission extends BasicPermission {80/**81* Creates a new JAXBPermission with the specified name.82*83* @param name84* The name of the JAXBPermission. As of 2.2 only "setDatatypeConverter"85* is defined.86*/87public JAXBPermission(String name) {88super(name);89}9091private static final long serialVersionUID = 1L;92}939495