8000450: Restrict access to com/sun/corba/se/impl package
authorcoffeys
Thu, 06 Jun 2013 14:10:44 +0100
changeset 18138 02cb2d482ed0
parent 18137 264000e285e9
child 18139 9fb8a2d427b5
8000450: Restrict access to com/sun/corba/se/impl package Reviewed-by: alanb, chegar, lancea
jdk/src/share/lib/security/java.security-linux
jdk/src/share/lib/security/java.security-macosx
jdk/src/share/lib/security/java.security-solaris
jdk/src/share/lib/security/java.security-windows
jdk/test/java/lang/SecurityManager/CheckPackageAccess.java
--- a/jdk/src/share/lib/security/java.security-linux	Thu Jun 06 05:32:26 2013 -0400
+++ b/jdk/src/share/lib/security/java.security-linux	Thu Jun 06 14:10:44 2013 +0100
@@ -177,6 +177,7 @@
 # corresponding RuntimePermission ("accessClassInPackage."+package) has
 # been granted.
 package.access=sun.,\
+               com.sun.corba.se.impl.,\
                com.sun.xml.internal.,\
                com.sun.imageio.,\
                com.sun.istack.internal.,\
@@ -218,6 +219,7 @@
 # checkPackageDefinition.
 #
 package.definition=sun.,\
+                   com.sun.corba.se.impl.,\
                    com.sun.xml.internal.,\
                    com.sun.imageio.,\
                    com.sun.istack.internal.,\
--- a/jdk/src/share/lib/security/java.security-macosx	Thu Jun 06 05:32:26 2013 -0400
+++ b/jdk/src/share/lib/security/java.security-macosx	Thu Jun 06 14:10:44 2013 +0100
@@ -178,6 +178,7 @@
 # corresponding RuntimePermission ("accessClassInPackage."+package) has
 # been granted.
 package.access=sun.,\
+               com.sun.corba.se.impl.,\
                com.sun.xml.internal.,\
                com.sun.imageio.,\
                com.sun.istack.internal.,\
@@ -219,6 +220,7 @@
 # checkPackageDefinition.
 #
 package.definition=sun.,\
+                   com.sun.corba.se.impl.,\
                    com.sun.xml.internal.,\
                    com.sun.imageio.,\
                    com.sun.istack.internal.,\
--- a/jdk/src/share/lib/security/java.security-solaris	Thu Jun 06 05:32:26 2013 -0400
+++ b/jdk/src/share/lib/security/java.security-solaris	Thu Jun 06 14:10:44 2013 +0100
@@ -179,6 +179,7 @@
 # corresponding RuntimePermission ("accessClassInPackage."+package) has
 # been granted.
 package.access=sun.,\
+               com.sun.corba.se.impl.,\
                com.sun.xml.internal.,\
                com.sun.imageio.,\
                com.sun.istack.internal.,\
@@ -219,6 +220,7 @@
 # checkPackageDefinition.
 #
 package.definition=sun.,\
+                   com.sun.corba.se.impl.,\
                    com.sun.xml.internal.,\
                    com.sun.imageio.,\
                    com.sun.istack.internal.,\
--- a/jdk/src/share/lib/security/java.security-windows	Thu Jun 06 05:32:26 2013 -0400
+++ b/jdk/src/share/lib/security/java.security-windows	Thu Jun 06 14:10:44 2013 +0100
@@ -178,6 +178,7 @@
 # corresponding RuntimePermission ("accessClassInPackage."+package) has
 # been granted.
 package.access=sun.,\
+               com.sun.corba.se.impl.,\
                com.sun.xml.internal.,\
                com.sun.imageio.,\
                com.sun.istack.internal.,\
@@ -219,6 +220,7 @@
 # checkPackageDefinition.
 #
 package.definition=sun.,\
+                   com.sun.corba.se.impl.,\
                    com.sun.xml.internal.,\
                    com.sun.imageio.,\
                    com.sun.istack.internal.,\
--- a/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java	Thu Jun 06 05:32:26 2013 -0400
+++ b/jdk/test/java/lang/SecurityManager/CheckPackageAccess.java	Thu Jun 06 14:10:44 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -23,8 +23,8 @@
 
 /*
  * @test
- * @bug 7146431
- * @summary Test that internal JAXP packages cannot be accessed
+ * @bug 7146431 8000450
+ * @summary Test that internal packages cannot be accessed
  */
 
 public class CheckPackageAccess {
@@ -32,6 +32,7 @@
     public static void main(String[] args) throws Exception {
 
         String[] pkgs = new String[] {
+            "com.sun.corba.se.impl.",
             "com.sun.org.apache.xerces.internal.utils.",
             "com.sun.org.apache.xalan.internal.utils." };
         SecurityManager sm = new SecurityManager();
@@ -40,7 +41,11 @@
             System.out.println("Checking package access for " + pkg);
             try {
                 sm.checkPackageAccess(pkg);
-                throw new Exception("Expected SecurityException not thrown");
+                throw new Exception("Expected PackageAccess SecurityException not thrown");
+            } catch (SecurityException se) { }
+            try {
+                sm.checkPackageDefinition(pkg);
+                throw new Exception("Expected PackageDefinition SecurityException not thrown");
             } catch (SecurityException se) { }
         }
     }