summaryrefslogtreecommitdiff
path: root/libjava/java/io/ObjectInputStream.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2001-12-21 22:51:41 +0000
committerTom Tromey <tromey@gcc.gnu.org>2001-12-21 22:51:41 +0000
commite3109d4c1738470671c5eeafc4d33b958e93180a (patch)
treee99cd67c1460483884ec1b91495d76bdbc871cd1 /libjava/java/io/ObjectInputStream.java
parentd47eb5d3f27cd5a42271366d82a4691ae5b931ee (diff)
downloadgcc-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.java7
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;