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
This commit is contained in:
Tom Tromey 2001-12-21 22:51:41 +00:00 committed by Tom Tromey
parent d47eb5d3f2
commit e3109d4c17
3 changed files with 16 additions and 5 deletions

View file

@ -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;