Remove SecuritySupport code that doesn't apply to the Invoker case.
git-svn-id: svn://10.0.0.236/trunk@91811 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
6555a0a14c
commit
e2859294b4
@ -270,20 +270,8 @@ public abstract class Invoker {
|
||||
byte[] bytes = bos.toByteArray();
|
||||
|
||||
Context cx = Context.getCurrentContext();
|
||||
SecuritySupport ss = cx == null ? null : cx.getSecuritySupport();
|
||||
Class c;
|
||||
if (ss != null) {
|
||||
// This will be compiled using the security domain of the
|
||||
// first class making a call. Then the result will be cached
|
||||
// and used by subsequent calls (which may not necessarily
|
||||
// be from the same security domain). Since Rhino generates
|
||||
// the code, this shouldn't be a security hole.
|
||||
Object securityDomain = cx.getSecurityDomainForStackDepth(-1);
|
||||
c = ss.defineClass(className, bytes, securityDomain);
|
||||
} else {
|
||||
classLoader.defineClass(className, bytes);
|
||||
c = classLoader.loadClass(className, true);
|
||||
}
|
||||
classLoader.defineClass(className, bytes);
|
||||
Class c = classLoader.loadClass(className, true);
|
||||
result = (Invoker)c.newInstance();
|
||||
|
||||
if (false) {
|
||||
|
||||
@ -270,20 +270,8 @@ public abstract class Invoker {
|
||||
byte[] bytes = bos.toByteArray();
|
||||
|
||||
Context cx = Context.getCurrentContext();
|
||||
SecuritySupport ss = cx == null ? null : cx.getSecuritySupport();
|
||||
Class c;
|
||||
if (ss != null) {
|
||||
// This will be compiled using the security domain of the
|
||||
// first class making a call. Then the result will be cached
|
||||
// and used by subsequent calls (which may not necessarily
|
||||
// be from the same security domain). Since Rhino generates
|
||||
// the code, this shouldn't be a security hole.
|
||||
Object securityDomain = cx.getSecurityDomainForStackDepth(-1);
|
||||
c = ss.defineClass(className, bytes, securityDomain);
|
||||
} else {
|
||||
classLoader.defineClass(className, bytes);
|
||||
c = classLoader.loadClass(className, true);
|
||||
}
|
||||
classLoader.defineClass(className, bytes);
|
||||
Class c = classLoader.loadClass(className, true);
|
||||
result = (Invoker)c.newInstance();
|
||||
|
||||
if (false) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user