Rhino SecurityException patch
   Date:
        Tue, 11 May 1999 12:25:50 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        Norris Boyd <norris@netscape.com>




Sorry if you aren't the right person to submit Rhino patches to.

I couldn't get Rhino to run under JDK1.2 with a SecurityManager installed
(e.g. java -Djava.security.manager=java.lang.SecurityManager).  I
understand the JavaAdapter stuff won't work - but I would still like to use
Rhino without that piece.

I've attached a small patch which catches and ignores the
SecurityExceptions so that Rhino can run with a SecurityManager but without
JavaAdapter.


Andrew
--
Andrew Wason
SoftCom, Inc.
aw@softcom.com
This commit is contained in:
norris%netscape.com 1999-05-11 16:46:30 +00:00
parent 20f8852310
commit a62a14d61d
2 changed files with 12 additions and 0 deletions

View File

@ -493,6 +493,12 @@ public final class Context {
Class adapterClass = Class.forName(adapterName);
ScriptableObject.defineClass(scope, adapterClass, sealed);
} catch (ClassNotFoundException e) {
} catch (SecurityException e) {
// Ignore AccessControlExceptions that may occur if a
// SecurityManager is installed:
// java.lang.RuntimePermission createClassLoader
// java.util.PropertyPermission
// org.mozilla.javascript.JavaAdapter read
}
// This creates the Packages and java package roots.

View File

@ -493,6 +493,12 @@ public final class Context {
Class adapterClass = Class.forName(adapterName);
ScriptableObject.defineClass(scope, adapterClass, sealed);
} catch (ClassNotFoundException e) {
} catch (SecurityException e) {
// Ignore AccessControlExceptions that may occur if a
// SecurityManager is installed:
// java.lang.RuntimePermission createClassLoader
// java.util.PropertyPermission
// org.mozilla.javascript.JavaAdapter read
}
// This creates the Packages and java package roots.