提交 a5c6f207 编写于 作者: C coffeys

8000450: Restrict access to com/sun/corba/se/impl package

Reviewed-by: alanb, chegar, lancea
上级 fa681a76
...@@ -177,6 +177,7 @@ keystore.type=jks ...@@ -177,6 +177,7 @@ keystore.type=jks
# corresponding RuntimePermission ("accessClassInPackage."+package) has # corresponding RuntimePermission ("accessClassInPackage."+package) has
# been granted. # been granted.
package.access=sun.,\ package.access=sun.,\
com.sun.corba.se.impl.,\
com.sun.xml.internal.,\ com.sun.xml.internal.,\
com.sun.imageio.,\ com.sun.imageio.,\
com.sun.istack.internal.,\ com.sun.istack.internal.,\
...@@ -218,6 +219,7 @@ package.access=sun.,\ ...@@ -218,6 +219,7 @@ package.access=sun.,\
# checkPackageDefinition. # checkPackageDefinition.
# #
package.definition=sun.,\ package.definition=sun.,\
com.sun.corba.se.impl.,\
com.sun.xml.internal.,\ com.sun.xml.internal.,\
com.sun.imageio.,\ com.sun.imageio.,\
com.sun.istack.internal.,\ com.sun.istack.internal.,\
......
...@@ -178,6 +178,7 @@ keystore.type=jks ...@@ -178,6 +178,7 @@ keystore.type=jks
# corresponding RuntimePermission ("accessClassInPackage."+package) has # corresponding RuntimePermission ("accessClassInPackage."+package) has
# been granted. # been granted.
package.access=sun.,\ package.access=sun.,\
com.sun.corba.se.impl.,\
com.sun.xml.internal.,\ com.sun.xml.internal.,\
com.sun.imageio.,\ com.sun.imageio.,\
com.sun.istack.internal.,\ com.sun.istack.internal.,\
...@@ -219,6 +220,7 @@ package.access=sun.,\ ...@@ -219,6 +220,7 @@ package.access=sun.,\
# checkPackageDefinition. # checkPackageDefinition.
# #
package.definition=sun.,\ package.definition=sun.,\
com.sun.corba.se.impl.,\
com.sun.xml.internal.,\ com.sun.xml.internal.,\
com.sun.imageio.,\ com.sun.imageio.,\
com.sun.istack.internal.,\ com.sun.istack.internal.,\
......
...@@ -179,6 +179,7 @@ keystore.type=jks ...@@ -179,6 +179,7 @@ keystore.type=jks
# corresponding RuntimePermission ("accessClassInPackage."+package) has # corresponding RuntimePermission ("accessClassInPackage."+package) has
# been granted. # been granted.
package.access=sun.,\ package.access=sun.,\
com.sun.corba.se.impl.,\
com.sun.xml.internal.,\ com.sun.xml.internal.,\
com.sun.imageio.,\ com.sun.imageio.,\
com.sun.istack.internal.,\ com.sun.istack.internal.,\
...@@ -219,6 +220,7 @@ package.access=sun.,\ ...@@ -219,6 +220,7 @@ package.access=sun.,\
# checkPackageDefinition. # checkPackageDefinition.
# #
package.definition=sun.,\ package.definition=sun.,\
com.sun.corba.se.impl.,\
com.sun.xml.internal.,\ com.sun.xml.internal.,\
com.sun.imageio.,\ com.sun.imageio.,\
com.sun.istack.internal.,\ com.sun.istack.internal.,\
......
...@@ -178,6 +178,7 @@ keystore.type=jks ...@@ -178,6 +178,7 @@ keystore.type=jks
# corresponding RuntimePermission ("accessClassInPackage."+package) has # corresponding RuntimePermission ("accessClassInPackage."+package) has
# been granted. # been granted.
package.access=sun.,\ package.access=sun.,\
com.sun.corba.se.impl.,\
com.sun.xml.internal.,\ com.sun.xml.internal.,\
com.sun.imageio.,\ com.sun.imageio.,\
com.sun.istack.internal.,\ com.sun.istack.internal.,\
...@@ -219,6 +220,7 @@ package.access=sun.,\ ...@@ -219,6 +220,7 @@ package.access=sun.,\
# checkPackageDefinition. # checkPackageDefinition.
# #
package.definition=sun.,\ package.definition=sun.,\
com.sun.corba.se.impl.,\
com.sun.xml.internal.,\ com.sun.xml.internal.,\
com.sun.imageio.,\ com.sun.imageio.,\
com.sun.istack.internal.,\ com.sun.istack.internal.,\
......
/* /*
* 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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
/* /*
* @test * @test
* @bug 7146431 * @bug 7146431 8000450
* @summary Test that internal JAXP packages cannot be accessed * @summary Test that internal packages cannot be accessed
*/ */
public class CheckPackageAccess { public class CheckPackageAccess {
...@@ -32,6 +32,7 @@ public class CheckPackageAccess { ...@@ -32,6 +32,7 @@ public class CheckPackageAccess {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
String[] pkgs = new String[] { String[] pkgs = new String[] {
"com.sun.corba.se.impl.",
"com.sun.org.apache.xerces.internal.utils.", "com.sun.org.apache.xerces.internal.utils.",
"com.sun.org.apache.xalan.internal.utils." }; "com.sun.org.apache.xalan.internal.utils." };
SecurityManager sm = new SecurityManager(); SecurityManager sm = new SecurityManager();
...@@ -40,7 +41,11 @@ public class CheckPackageAccess { ...@@ -40,7 +41,11 @@ public class CheckPackageAccess {
System.out.println("Checking package access for " + pkg); System.out.println("Checking package access for " + pkg);
try { try {
sm.checkPackageAccess(pkg); 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) { } } catch (SecurityException se) { }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册