1 /* 2 * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package javax.xml.bind; 27 28 import java.security.BasicPermission; 29 30 /** 31 * This class is for JAXB permissions. A {@code JAXBPermission} 32 * contains a name (also referred to as a "target name") but 33 * no actions list; you either have the named permission 34 * or you don't. 35 * 36 * <P> 37 * The target name is the name of the JAXB permission (see below). 38 * 39 * <P> 40 * The following table lists all the possible {@code JAXBPermission} target names, 41 * and for each provides a description of what the permission allows 42 * and a discussion of the risks of granting code the permission. 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 has 60 * VM-wide singleton semantics, before a genuine JAXB implementation sets one. 61 * This allows malicious code to gain access to objects that it may otherwise 62 * not have access to, such as {@link java.awt.Frame#getFrames()} that belongs to 63 * another application running in the same JVM. 64 * </td> 65 * </tr> 66 * </table> 67 * 68 * @see java.security.BasicPermission 69 * @see java.security.Permission 70 * @see java.security.Permissions 71 * @see java.security.PermissionCollection 72 * @see java.lang.SecurityManager 73 * 74 * @author Joe Fialli 75 * @since 1.7, JAXB 2.2 76 */ 77 78 /* code was borrowed originally from java.lang.RuntimePermission. */ 79 public final class JAXBPermission extends BasicPermission { 80 /** 81 * Creates a new JAXBPermission with the specified name. 82 * 83 * @param name 84 * The name of the JAXBPermission. As of 2.2 only "setDatatypeConverter" 85 * is defined. 86 */ 87 public JAXBPermission(String name) { 88 super(name); 89 } 90 91 private static final long serialVersionUID = 1L; 92 }