changeset 5436:48a63b88ca4a

7143535: ScriptEngine corrected permissions Reviewed-by: jjh
author sundar
date Sat, 04 Aug 2012 21:16:20 +0530
parents 3cb729c0b083
children 32f792cd1d45
files src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java	Fri Aug 03 18:00:28 2012 +0400
+++ b/src/share/classes/com/sun/script/javascript/RhinoScriptEngine.java	Sat Aug 04 21:16:20 2012 +0530
@@ -146,7 +146,11 @@
      */
     public RhinoScriptEngine() {
         if (System.getSecurityManager() != null) {
-            accCtxt = AccessController.getContext();
+            try {
+                AccessController.checkPermission(new AllPermission());
+            } catch (AccessControlException ace) {
+                accCtxt = AccessController.getContext();
+            }
         }
 
         Context cx = enterContext();