8155513: Deprivilege jdk.charsets

Reviewed-by: alanb, chegar
This commit is contained in:
Mandy Chung 2016-05-05 22:39:36 -07:00
parent b932c60a85
commit b58e171061
3 changed files with 18 additions and 1 deletions

View File

@ -12,6 +12,15 @@ grant codeBase "jrt:/java.compiler" {
permission java.security.AllPermission;
};
grant codeBase "jrt:/jdk.charsets" {
permission java.io.FilePermission "${java.home}/-", "read";
permission java.util.PropertyPermission "os.name", "read";
permission java.util.PropertyPermission "sun.nio.cs.map", "read";
permission java.lang.RuntimePermission "charsetProvider";
permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.misc";
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.cs";
};
grant codeBase "jrt:/jdk.crypto.ucrypto" {
permission java.lang.RuntimePermission "accessClassInPackage.sun.security.*";
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.ch";

View File

@ -113,7 +113,7 @@ for where in app; do
av="$av -Djava.security.manager -Djava.security.policy==$TESTSRC/default-pol";;
cp-policy) css="$CSS FOO";
av="$av -Djava.security.manager
-Djava.security.policy==$TESTSRC/charsetProvider.sp";;
-Djava.security.policy=$TESTSRC/charsetProvider.sp";;
esac
if (set -x; $JAVA ${TESTVMOPTS} $av Test $css) 2>&1; then
continue;

View File

@ -1,3 +1,11 @@
grant codeBase "jrt:/jdk.charsets" {
permission java.io.FilePermission "${java.home}/-", "read";
permission java.util.PropertyPermission "os.name", "read";
permission java.util.PropertyPermission "sun.nio.cs.map", "read";
permission java.lang.RuntimePermission "charsetProvider";
permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.misc";
permission java.lang.RuntimePermission "accessClassInPackage.sun.nio.cs";
};
// default permissions granted to all domains