зеркало из https://github.com/mono/ikvm-fork.git
Avoid security manager check for assembly class loaders. The runtime should be priviliged to create the default assembly class loader and a custom security manager might recursively require the assembly class loader to be loaded (which is only "supported" for custom assembly class loaders).
This commit is contained in:
Родитель
32238d1dcd
Коммит
5a3a196d92
|
@ -43,7 +43,13 @@ public final class AssemblyClassLoader extends ClassLoader
|
|||
|
||||
public AssemblyClassLoader(Assembly assembly)
|
||||
{
|
||||
super(null);
|
||||
this(assembly, System.getSecurityManager());
|
||||
}
|
||||
|
||||
// this constructor is used by the runtime to avoid the security check (by passing in null as the security manager)
|
||||
AssemblyClassLoader(Assembly assembly, SecurityManager security)
|
||||
{
|
||||
super(null, security);
|
||||
this.assembly = assembly;
|
||||
}
|
||||
|
||||
|
|
|
@ -216,7 +216,13 @@ public abstract class ClassLoader {
|
|||
* @since 1.2
|
||||
*/
|
||||
protected ClassLoader(ClassLoader parent) {
|
||||
SecurityManager security = System.getSecurityManager();
|
||||
this(parent, System.getSecurityManager());
|
||||
}
|
||||
|
||||
// private constructor for use by ikvm.runtime.AssemblyClassLoader
|
||||
// (to skip the security manager check)
|
||||
@ikvm.lang.Internal
|
||||
protected ClassLoader(ClassLoader parent, SecurityManager security) {
|
||||
if (security != null) {
|
||||
security.checkCreateClassLoader();
|
||||
}
|
||||
|
|
|
@ -1159,7 +1159,7 @@ namespace IKVM.Internal
|
|||
|
||||
public object run()
|
||||
{
|
||||
return new ikvm.runtime.AssemblyClassLoader(assembly);
|
||||
return new ikvm.runtime.AssemblyClassLoader(assembly, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче