From: Bruce Momjian Date: Sun, 26 Aug 2001 17:08:48 +0000 (+0000) Subject: Please pull this patch. It breaks JDBC1 support. The JDBC1 code no X-Git-Tag: REL7_2_BETA1~606 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d162c0d1a7fa1a4a1f3dae46965ef86f0ebe8f6;p=postgresql Please pull this patch. It breaks JDBC1 support. The JDBC1 code no longer compiles, due to objects being referenced in this patch that do not exist in JDK1.1. Barry Lind --------------------------------------------------------------------------- The JDBC driver requires permission java.net.SocketPermission "host:port", "connect"; in the policy file of the application using the JDBC driver in the postgresql.jar file. Since the Socket() call in the driver is not protected by AccessController.doPrivileged() this permission must also be granted to the entire application. --- diff --git a/src/interfaces/jdbc/org/postgresql/PG_Stream.java b/src/interfaces/jdbc/org/postgresql/PG_Stream.java index ebee9e95fd..71a090b0d4 100644 --- a/src/interfaces/jdbc/org/postgresql/PG_Stream.java +++ b/src/interfaces/jdbc/org/postgresql/PG_Stream.java @@ -5,13 +5,12 @@ import java.lang.*; import java.net.*; import java.util.*; import java.sql.*; -import java.security.*; import org.postgresql.*; import org.postgresql.core.*; import org.postgresql.util.*; /** - * $Id: PG_Stream.java,v 1.12 2001/08/26 01:06:20 momjian Exp $ + * $Id: PG_Stream.java,v 1.13 2001/08/26 17:08:48 momjian Exp $ * * This class is used by Connection & PGlobj for communicating with the * backend. @@ -29,25 +28,6 @@ public class PG_Stream BytePoolDim1 bytePoolDim1 = new BytePoolDim1(); BytePoolDim2 bytePoolDim2 = new BytePoolDim2(); - private static class PrivilegedSocket - implements PrivilegedExceptionAction - { - private String host; - private int port; - - PrivilegedSocket(String host, int port) - { - this.host = host; - this.port = port; - } - - public Object run() throws Exception - { - return new Socket(host, port); - } - } - - /** * Constructor: Connect to the PostgreSQL back end and return * a stream connection. @@ -58,13 +38,7 @@ public class PG_Stream */ public PG_Stream(String host, int port) throws IOException { - PrivilegedSocket ps = new PrivilegedSocket(host, port); - try { - connection = (Socket)AccessController.doPrivileged(ps); - } - catch(PrivilegedActionException pae){ - throw (IOException)pae.getException(); - } + connection = new Socket(host, port); // Submitted by Jason Venner adds a 10x speed // improvement on FreeBSD machines (caused by a bug in their TCP Stack)