changeset 6385:d90ab1e5f50a

8000450: Restrict access to com/sun/corba/se/impl package Reviewed-by: alanb, chegar, lancea
author coffeys
date Fri, 25 Oct 2013 22:21:34 +0100
parents 3e7df93144c6
children 1e83971f6c9d
files src/share/lib/security/java.security 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	Fri Sep 27 00:01:04 2013 +0100
+++ b/src/share/lib/security/java.security	Fri Oct 25 22:21:34 2013 +0100
@@ -124,6 +124,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.,\
@@ -162,6 +163,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	Fri Sep 27 00:01:04 2013 +0100
+++ b/src/share/lib/security/java.security-macosx	Fri Oct 25 22:21:34 2013 +0100
@@ -125,6 +125,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.,\
@@ -164,6 +165,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	Fri Sep 27 00:01:04 2013 +0100
+++ b/src/share/lib/security/java.security-solaris	Fri Oct 25 22:21:34 2013 +0100
@@ -126,6 +126,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.,\
@@ -164,6 +165,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	Fri Sep 27 00:01:04 2013 +0100
+++ b/src/share/lib/security/java.security-windows	Fri Oct 25 22:21:34 2013 +0100
@@ -125,6 +125,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.,\
@@ -164,6 +165,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	Fri Sep 27 00:01:04 2013 +0100
+++ b/test/java/lang/SecurityManager/CheckPackageAccess.java	Fri Oct 25 22:21:34 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.",
 	    "com.sun.script." };
@@ -41,7 +42,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) { }
         }
     }