diff options
Diffstat (limited to 'libjava/java/io/ObjectInputStream.java')
-rw-r--r-- | libjava/java/io/ObjectInputStream.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libjava/java/io/ObjectInputStream.java b/libjava/java/io/ObjectInputStream.java index 7a67f3fb9a8..b530f4c045f 100644 --- a/libjava/java/io/ObjectInputStream.java +++ b/libjava/java/io/ObjectInputStream.java @@ -528,8 +528,11 @@ public class ObjectInputStream extends InputStream throws SecurityException { if (enable) - if (getClass ().getClassLoader () != null) - throw new SecurityException ("Untrusted ObjectInputStream subclass attempted to enable object resolution"); + { + SecurityManager sm = System.getSecurityManager (); + if (sm != null) + sm.checkPermission (new SerializablePermission ("enableSubtitution")); + } boolean old_val = this.resolveEnabled; this.resolveEnabled = enable; |