changeset 7347:c4480e0d9f53

8000450: Restrict access to com/sun/corba/se/impl package Reviewed-by: alanb, chegar, lancea
author coffeys
date Thu, 06 Jun 2013 14:10:44 +0100
parents 571e5f452640
children 37aa82c52317
files src/share/lib/security/java.security-linux src/share/lib/security/java.security-macosx src/share/lib/security/java.security-solaris src/share/lib/security/java.security-windows test/java/lang/SecurityManager/CheckPackageAccess.java
diffstat 5 files changed, 17 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/lib/security/java.security-linux	Thu Jun 06 05:32:26 2013 -0400
+++ b/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/src/share/lib/security/java.security-macosx	Thu Jun 06 05:32:26 2013 -0400
+++ b/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/src/share/lib/security/java.security-solaris	Thu Jun 06 05:32:26 2013 -0400
+++ b/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/src/share/lib/security/java.security-windows	Thu Jun 06 05:32:26 2013 -0400
+++ b/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/test/java/lang/SecurityManager/CheckPackageAccess.java	Thu Jun 06 05:32:26 2013 -0400
+++ b/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) { }
         }
     }