diff options
author | Tom Tromey <tromey@redhat.com> | 2001-12-21 22:51:41 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2001-12-21 22:51:41 +0000 |
commit | e3109d4c1738470671c5eeafc4d33b958e93180a (patch) | |
tree | e99cd67c1460483884ec1b91495d76bdbc871cd1 /libjava/java/io/ObjectInputStream.java | |
parent | d47eb5d3f27cd5a42271366d82a4691ae5b931ee (diff) | |
download | gcc-e3109d4c1738470671c5eeafc4d33b958e93180a.tar.gz |
ObjectInputStream.java (enableResolveObject): Use correct security check.
* java/io/ObjectInputStream.java (enableResolveObject): Use
correct security check.
* java/io/ObjectOutputStream.java (enableReplaceObject): Use
correct security check.
From-SVN: r48256
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; |