# HG changeset patch # User coffeys # Date 1382736094 -3600 # Node ID d90ab1e5f50ad0a96fa10bb288e5ebe1946acb16 # Parent 3e7df93144c66e9f1238aac7c07b15052a3d1faf 8000450: Restrict access to com/sun/corba/se/impl package Reviewed-by: alanb, chegar, lancea diff -r 3e7df93144c6 -r d90ab1e5f50a src/share/lib/security/java.security --- 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.,\ diff -r 3e7df93144c6 -r d90ab1e5f50a src/share/lib/security/java.security-macosx --- 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.,\ diff -r 3e7df93144c6 -r d90ab1e5f50a src/share/lib/security/java.security-solaris --- 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.,\ diff -r 3e7df93144c6 -r d90ab1e5f50a src/share/lib/security/java.security-windows --- 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.,\ diff -r 3e7df93144c6 -r d90ab1e5f50a test/java/lang/SecurityManager/CheckPackageAccess.java --- 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) { } } }