diff options
author | Tom Tromey <tromey@redhat.com> | 2003-09-25 07:46:19 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2003-09-25 07:46:19 +0000 |
commit | b9f42bb06092d78b84964ce1ce3af703bad2cc7d (patch) | |
tree | c440653c21ba6d47253f60036888a563bd7f60a2 /libjava/java/lang/reflect | |
parent | d70f15d251b73bbddfd304f1f8ae2d7367dcc79f (diff) | |
download | gcc-b9f42bb06092d78b84964ce1ce3af703bad2cc7d.zip gcc-b9f42bb06092d78b84964ce1ce3af703bad2cc7d.tar.gz gcc-b9f42bb06092d78b84964ce1ce3af703bad2cc7d.tar.bz2 |
Proxy.java (generate): Uncomment protection domain code.
* java/lang/reflect/Proxy.java (generate): Uncomment protection
domain code.
* java/lang/natClassLoader.cc (defineClass): Added `loader'
argument.
(linkClass0): Now in VMClassLoader.
(markClassErrorState0): Likewise.
(getSystemClassLoaderInternal): New method.
* java/lang/natClass.cc (initializeClass): Use
VMClassLoader::resolveClass.
* java/lang/ClassLoader.java: New version, from Classpath.
* java/lang/Class.java (getProtectionDomain):
protectionDomainPermission and unknownProtectionDomain now in
VMClassLoader.
* java/lang/Class.h: VMClassLoader now a friend class.
* gnu/gcj/runtime/VMClassLoader.java (instance): Now
package-private.
* gcj/javaprims.h: Regenerated class list.
* resolve.cc (_Jv_PrepareClass): Use VMClassLoader::resolveClass.
* java/lang/VMClassLoader.java: New version from Classpath;
modified for libgcj use.
From-SVN: r71765
Diffstat (limited to 'libjava/java/lang/reflect')
-rw-r--r-- | libjava/java/lang/reflect/Proxy.java | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/libjava/java/lang/reflect/Proxy.java b/libjava/java/lang/reflect/Proxy.java index 1b38a48..9009bc8 100644 --- a/libjava/java/lang/reflect/Proxy.java +++ b/libjava/java/lang/reflect/Proxy.java @@ -1335,17 +1335,10 @@ public class Proxy implements Serializable { // XXX Do we require more native support here? - // XXX Security hole - it is possible for another thread to grab the - // VMClassLoader.defineClass Method object, and abuse it while we - // have temporarily made it accessible. Do we need to add some - // synchronization lock to prevent user reflection while we use it? - - // XXX This is waiting on VM support for protection domains. - Class vmClassLoader = Class.forName("java.lang.VMClassLoader"); Class[] types = {ClassLoader.class, String.class, byte[].class, int.class, int.class, - /* ProtectionDomain.class */ }; + ProtectionDomain.class }; Method m = vmClassLoader.getDeclaredMethod("defineClass", types); // Bypass the security check of setAccessible(true), since this @@ -1354,7 +1347,7 @@ public class Proxy implements Serializable m.flag = true; Object[] args = {loader, qualName, bytecode, new Integer(0), new Integer(bytecode.length), - /* Object.class.getProtectionDomain() */ }; + Object.class.getProtectionDomain() }; Class clazz = (Class) m.invoke(null, args); m.flag = false; |