8154192: Deprivilege java.scripting module
authorsundar
Wed, 18 May 2016 15:03:39 +0530
changeset 38377 f5b2f9c076ef
parent 38376 08549412f0dc
child 38378 3ae899b05d36
8154192: Deprivilege java.scripting module Reviewed-by: jlaskey, alanb
jdk/src/java.base/share/conf/security/java.policy
jdk/test/javax/script/ProviderTest.sh
--- a/jdk/src/java.base/share/conf/security/java.policy	Wed May 18 10:42:29 2016 +0200
+++ b/jdk/src/java.base/share/conf/security/java.policy	Wed May 18 15:03:39 2016 +0530
@@ -80,6 +80,10 @@
         permission java.security.AllPermission;
 };
 
+grant codeBase "jrt:/java.scripting" {
+        permission java.security.AllPermission;
+};
+
 grant codeBase "jrt:/jdk.scripting.nashorn" {
         permission java.security.AllPermission;
 };
--- a/jdk/test/javax/script/ProviderTest.sh	Wed May 18 10:42:29 2016 +0200
+++ b/jdk/test/javax/script/ProviderTest.sh	Wed May 18 15:03:39 2016 +0530
@@ -43,8 +43,18 @@
     -C ${TESTCLASSES} DummyScriptEngineFactory.class \
     -C "${TESTSRC}" META-INF/services/javax.script.ScriptEngineFactory
 
-echo "Running test ..."
+echo "Running test with security manager ..."
+$JAVA ${TESTVMOPTS} -Djava.security.manager -classpath \
+  "${TESTCLASSES}${PS}${TESTCLASSES}/dummy.jar" \
+  ProviderTest
 
+ret=$?
+if [ $ret -ne 0 ]
+then
+  exit $ret
+fi
+
+echo "Running test without security manager ..."
 $JAVA ${TESTVMOPTS} -classpath \
   "${TESTCLASSES}${PS}${TESTCLASSES}/dummy.jar" \
   ProviderTest