Re: [BUGS] More SSL questions..
"Magnus Hagander" <[email protected]>
| Newsgroups | gmane.comp.db.postgresql.devel.win32 |
|---|---|
| Message-ID | <[email protected]> |
Builds with the attached patch. Tested the following:
>>>>> Given that decision it seems like the best names are
>>>>>
>>>>> APPDATA/postgresql/pgpass.txt
Works.
>>>>> APPDATA/postgresql/psqlrc.txt
Works.
>>>>> APPDATA/postgresql/psql_history
Does not appear to work. Do I need to do anything to make psql create
this file?
A quick look at input.c makes it seem like this is only used when
READLINE is enabled. And READLINE is disabled on win32 because it
breaks.
>>>>> APPDATA/postgresql/postgresql.crt
>>>>> APPDATA/postgresql/postgresql.key
Not sure exactly how to test these :-(
>>>>> APPDATA/postgresql/root.crt
Works insofar that it prevents me to connect if I put an invalid
certificate in that file, and permits me to connect if I put the correct
cert there. AFAIK, that should be all there is to it :-)
Also verified that it still passes installcheck-parallel.
//Magnus
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
pqhome.patch
(application/octet-stream, 2.6 KB)
Index: src/interfaces/libpq/Makefile
===================================================================
RCS file: /projects/cvsroot/pgsql/src/interfaces/libpq/Makefile,v
retrieving revision 1.125
diff -c -r1.125 Makefile
*** src/interfaces/libpq/Makefile 31 Dec 2004 22:03:50 -0000 1.125
--- src/interfaces/libpq/Makefile 6 Jan 2005 21:01:16 -0000
***************
*** 55,61 ****
# matter.)
SHLIB_LINK += $(filter -lcrypt -ldes -lkrb -lcom_err -lcrypto -lk5crypto -lkrb5 -lssl -lsocket -lnsl -lresolv -lintl, $(LIBS)) $(PTHREAD_LIBS)
ifeq ($(PORTNAME), win32)
! SHLIB_LINK += -lwsock32 -lws2_32 $(filter -leay32 -lssleay32, $(LIBS))
endif
--- 55,61 ----
# matter.)
SHLIB_LINK += $(filter -lcrypt -ldes -lkrb -lcom_err -lcrypto -lk5crypto -lkrb5 -lssl -lsocket -lnsl -lresolv -lintl, $(LIBS)) $(PTHREAD_LIBS)
ifeq ($(PORTNAME), win32)
! SHLIB_LINK += -lwsock32 -lws2_32 -lshell32 $(filter -leay32 -lssleay32, $(LIBS))
endif
Index: src/interfaces/libpq/fe-connect.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v
retrieving revision 1.297
diff -c -r1.297 fe-connect.c
*** src/interfaces/libpq/fe-connect.c 6 Jan 2005 18:29:10 -0000 1.297
--- src/interfaces/libpq/fe-connect.c 6 Jan 2005 21:12:00 -0000
***************
*** 35,40 ****
--- 35,41 ----
#ifdef WIN32
#include "win32.h"
+ #define _WIN32_IE 0x0400
#include <shlobj.h>
#else
#include <sys/socket.h>
Index: src/interfaces/libpq/fe-secure.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/interfaces/libpq/fe-secure.c,v
retrieving revision 1.64
diff -c -r1.64 fe-secure.c
*** src/interfaces/libpq/fe-secure.c 6 Jan 2005 18:29:10 -0000 1.64
--- src/interfaces/libpq/fe-secure.c 6 Jan 2005 21:02:06 -0000
***************
*** 817,822 ****
--- 817,823 ----
fnbuf);
return 0;
}
+ #ifndef WIN32
if (!S_ISREG(buf.st_mode) || (buf.st_mode & 0077) ||
buf.st_uid != getuid())
{
***************
*** 825,830 ****
--- 826,832 ----
fnbuf);
return 0;
}
+ #endif
if ((fp = fopen(fnbuf, "r")) == NULL)
{
printfPQExpBuffer(&conn->errorMessage,
Index: src/port/path.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/port/path.c,v
retrieving revision 1.48
diff -c -r1.48 path.c
*** src/port/path.c 6 Jan 2005 18:29:11 -0000 1.48
--- src/port/path.c 6 Jan 2005 21:01:40 -0000
***************
*** 18,23 ****
--- 18,24 ----
#include <ctype.h>
#include <sys/stat.h>
#ifdef WIN32
+ #define _WIN32_IE 0x0400
#include <shlobj.h>
#else
#include <unistd.h>