Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3d162c0

Browse files
committed
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.
1 parent e1635b4 commit 3d162c0

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

src/interfaces/jdbc/org/postgresql/PG_Stream.java

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
import java.net.*;
66
import java.util.*;
77
import java.sql.*;
8-
import java.security.*;
98
import org.postgresql.*;
109
import org.postgresql.core.*;
1110
import org.postgresql.util.*;
1211

1312
/**
14-
* $Id: PG_Stream.java,v 1.12 2001/08/26 01:06:20 momjian Exp $
13+
* $Id: PG_Stream.java,v 1.13 2001/08/26 17:08:48 momjian Exp $
1514
*
1615
* This class is used by Connection & PGlobj for communicating with the
1716
* backend.
@@ -29,25 +28,6 @@ public class PG_Stream
2928
BytePoolDim1 bytePoolDim1 = new BytePoolDim1();
3029
BytePoolDim2 bytePoolDim2 = new BytePoolDim2();
3130

32-
private static class PrivilegedSocket
33-
implements PrivilegedExceptionAction
34-
{
35-
private String host;
36-
private int port;
37-
38-
PrivilegedSocket(String host, int port)
39-
{
40-
this.host = host;
41-
this.port = port;
42-
}
43-
44-
public Object run() throws Exception
45-
{
46-
return new Socket(host, port);
47-
}
48-
}
49-
50-
5131
/**
5232
* Constructor: Connect to the PostgreSQL back end and return
5333
* a stream connection.
@@ -58,13 +38,7 @@ public Object run() throws Exception
5838
*/
5939
public PG_Stream(String host, int port) throws IOException
6040
{
61-
PrivilegedSocket ps = new PrivilegedSocket(host, port);
62-
try {
63-
connection = (Socket)AccessController.doPrivileged(ps);
64-
}
65-
catch(PrivilegedActionException pae){
66-
throw (IOException)pae.getException();
67-
}
41+
connection = new Socket(host, port);
6842

6943
// Submitted by Jason Venner <jason@idiom.com> adds a 10x speed
7044
// improvement on FreeBSD machines (caused by a bug in their TCP Stack)

0 commit comments

Comments
 (0)