Commit Graph

460 Commits

Author SHA1 Message Date
Tom Lane ae02cf3c44 Guard against macro versions of isblank(). 2003-04-12 22:28:33 +00:00
Tom Lane 5674460bb0 Fix error recovery for SSL_read/SSL_write calls. 2003-04-10 23:03:08 +00:00
Tom Lane 14e6823c7c Don't re-invent the strchr() wheel. 2003-04-03 21:50:23 +00:00
Tom Lane 61c9ea0f3c Fix load_user/load_group to not leave dangling pointers around if the
config files are present on one pass and not present on a later pass.
2003-04-03 21:25:02 +00:00
Tom Lane 794162bb1a Fix convSockAddr6to4(): eliminate bogus assumptions about byte ordering,
remove useless SockAddr_ntop() call.  Per report from Andreas Pflug.
2003-04-02 20:00:21 +00:00
Tom Lane 1da6eb7fda Whack getaddrinfo() patch around until it works, more or less, on
machines without IPv6.  Or at least it works on HPUX 10.20 ...
2003-04-02 00:49:28 +00:00
Peter Eisentraut 82a91eb54e Simplify the socket handling code by supplying a replacement getaddrinfo()
function if the OS doesn't provide one.
2003-03-29 11:31:52 +00:00
Bruce Momjian bf7ca0a769 [ Backpatch to 7.3.X.]
SSL_read/write can error needing ERROR_WANT_READ or ERROR_WANT_WRITE.
2003-03-29 05:00:15 +00:00
Bruce Momjian 0184db50a0 [ Backpatch to 7.3.X.]
typing error in src/backend/libpq/be-secure.c ???

Long Description
In src/backend/libpq/be-secure.c: secure_write
on SSL_ERROR_WANT_WRITE call secure_read instead
secure_write again. May be is this a typing error?

Sergey N. Yatskevich (syatskevich@n21lab.gosniias.msk.ru)
2003-03-29 03:56:44 +00:00
Bruce Momjian a18331004a Add start time to pg_stat_activity
Neil Conway
2003-03-20 03:34:57 +00:00
Bruce Momjian 35911088ff A typo in src/backend/libpq/hba.c breaks local ident authentication
in the SO_PEERCRED case. elif is misspelled as elsif for the test.
A patch is attached.

Bruno Wolff III
2003-03-15 16:18:25 +00:00
Bruce Momjian 0e010a54a3 Update FAQ's in head and 7.3.X. 2003-02-14 14:05:00 +00:00
Tom Lane 874e8cef99 Remove bogus manipulation of SIGPIPE; the backend already runs with
SIGPIPE disabled, and does not need to waste two syscalls per I/O on it.
2003-02-14 00:18:41 +00:00
Tom Lane ef5842b5f7 #ifdef out stuff that shouldn't be compiled when not USE_SSL.
Curious that gcc doesn't complain about unreferenced static variables.
2003-02-03 22:33:51 +00:00
Bruce Momjian 0d3e36b668 Move pg_service.conf.sample to /interfaces/libpq. 2003-02-03 14:24:07 +00:00
Tom Lane 15ab7a8720 Where available, use utime() or utimes() to update the file mod time
of the socket file and socket lock file; this should prevent both of them
from being removed by even the stupidest varieties of /tmp-cleaning
script.  Per suggestion from Giles Lean.
2003-01-25 05:19:47 +00:00
Bruce Momjian 1eddbd81fa Readd #include netinet/in.h for FreeBSD. 2003-01-14 22:52:57 +00:00
Peter Eisentraut 9df2c44032 Fix IPv6 detection and IPv6 to 4 conversion to use only standard
interfaces.
2003-01-09 14:35:03 +00:00
Bruce Momjian 7aa2038d82 Remove 'const' from secure_write, to prevent compiler warning. 2003-01-08 23:34:22 +00:00
Bruce Momjian b56af49849 The second was that renegotiation was just plain broken. I can't
believe I didn't notice this before -- once 64k was sent to/from the
server the client would crash.  Basicly, in 7.3 the server SSL code set
the initial state to "about to renegotiate" without actually starting
the renegotiation.  In addition, the server and client didn't properly
handle the SSL_ERROR_WANT_(READ|WRITE) error.  This is fixed in the
second patch.

Nathan Mueller
2003-01-08 23:18:25 +00:00
Bruce Momjian 6ccb5aebad I was playing around with 7.3.1 and found some more SSL problems. The
first, that I missed when checking over 7.3.1, was that the client
method was switched to SSLv23 along with the server.  The SSLv23 client
method does SSLv2 by default, but can also understand SSLv3.  In our
situation the SSLv2 backwords compatibility is really only needed on the
server.  This is the first patch.

The last thing is that I found a way for the server to understand SSLv2
HELLO messages (sent by pre-7.3 clients) but then get them to talk
SSLv3.  This is the last one.

Nathan Mueller
2003-01-08 22:56:58 +00:00
Bruce Momjian 1b59b442ce Add connection service file. 2003-01-07 20:29:30 +00:00
Peter Eisentraut 6e90803f90 Fix for systems that don't have INET_ADDRSTRLEN. 2003-01-06 09:58:36 +00:00
Bruce Momjian c3e9699f21 Enable IPv6 connections to the server, and add pg_hba.conf IPv6 entries
if the OS supports it.  Code will still compile on non-IPv6-aware
machines (feature added by Bruce).

Nigel Kukard
2003-01-06 03:18:27 +00:00
Bruce Momjian 572d95150e Update SSL error message for improper permissions. Backpatch to 7.3.X. 2002-12-23 22:19:00 +00:00
PostgreSQL Daemon 750a0e676e From the SSL_CTX_new man page:
"SSLv23_method(void), SSLv23_server_method(void), SSLv23_client_method(void)

 A TLS/SSL connection established with these methods will understand the SSLv2,
 SSLv3, and TLSv1 protocol. A client will send out SSLv2 client hello messages
 and will indicate that it also understands SSLv3 and TLSv1. A server will
 understand SSLv2, SSLv3, and TLSv1 client hello messages. This is the best
 choice when compatibility is a concern."

This will maintain backwards compatibility for those us that don't use
TLS connections ...
2002-12-18 13:15:15 +00:00
Bruce Momjian c78701697c The actual segfault was caused by a double pfree(), but ISTM that
failing to find pg_hba.conf should be a fatal error anyway, so I
increased the priority of the elog() from LOG to FATAL and refactored
the code a little bit.

Neil Conway
2002-12-14 18:49:37 +00:00
Bruce Momjian fb2d7a24f9 Ok, I think I've gotten this figured out now. I saw this comment in
pqcomm.c, switched the ERROR logs to COMMERROR logs and it all works.
I've attached a patch to be-secure.c that fixes all my problems.

Nathan Mueller
2002-12-14 18:39:14 +00:00
Bruce Momjian 023ff17178 Remove strerror output for openssl SYSCALL error check. 2002-12-13 05:51:29 +00:00
Bruce Momjian 482ed836f7 Check SSL_get_error() value SSL_ERROR_SYSCALL to see if SSL_read()
returned -1, per SSL_get_error() documentation.

Nathan Mueller
2002-12-12 22:42:39 +00:00
Bruce Momjian 92d77c69e5 Fix line count error reporting in config files, like pg_hba.conf, per
report from Oliver Elphick.

Backpatch to 7.3.
2002-12-11 22:17:11 +00:00
Bruce Momjian 38ffbb95d5 Back out V6 code, caused postmaster startup failure. 2002-12-06 04:37:05 +00:00
Bruce Momjian 4bfd1ad9e0 Add missing v6utils file. 2002-12-06 04:18:11 +00:00
Bruce Momjian 3bf160131d Updated IPv6 patch to fix netmask. 2002-12-06 03:49:19 +00:00
Bruce Momjian 8fc86dd593 We have just finished porting the old KAME IPv6 patch over to
postgresql version 7.3, but yea... this patch adds full IPv6
support to postgres. I've tested it out on 7.2.3 and has
been running perfectly stable.

CREDITS:
 The KAME Project  (Initial patch)
 Nigel Kukard  <nkukard@lbsd.net>
 Johan Jordaan  <johanj@lando.co.za>
2002-12-06 03:46:37 +00:00
Bruce Momjian f7a3d742df Clearify variables names so it is clear which variable is the
client-supplied password and which is from pg_shadow.
2002-12-05 18:52:43 +00:00
Bruce Momjian 44ab596b01 Allow 'password' encryption even when pg_shadow has MD5 passwords, per
report from Terry Yapt and Hiroshi.

Backpatch to 7.3.
2002-12-05 18:39:43 +00:00
Bruce Momjian 6f0ebe3fba Deal with cases where getpeereid _and_ another creditial method is
supported.
2002-12-03 22:09:20 +00:00
Bruce Momjian f988edb4e1 Add OpenBSD local indent credentials, from William Ahern. 2002-12-03 21:50:44 +00:00
Tom Lane 3a4b3ac3a5 Remove inappropriate inclusions of OpenSSL internal header e_os.h,
as well as unnecessary (and incorrect on Windows) assignments to
errno/SOCK_ERRNO.
2002-11-07 18:45:51 +00:00
Bruce Momjian 793a4ba35e Add SSL documentation info to README.SSL 2002-10-03 17:26:14 +00:00
Bruce Momjian a0bf2503ea The attached patch fixes a number of issues related to compiling the
client
utilities (libpq.dll and psql.exe) for win32 (missing defines,
adjustments to
includes, pedantic casting, non-existent functions) per:
   http://developer.postgresql.org/docs/postgres/install-win32.html.

It compiles cleanly under Windows 2000 using Visual Studio .net. Also
compiles clean and passes all regression tests (regular and contrib)
under Linux.

In addition to a review by the usual suspects, it would be very
desirable for  someone well versed in the peculiarities of win32 to take
a look.

Joe Conway
2002-10-03 17:09:42 +00:00
Bruce Momjian 2a1e4a9006 Add Bear's SSL comments. 2002-09-29 04:06:54 +00:00
Bruce Momjian 15b95cf872 Allow SSL to work withouth client-side certificate infrastructure. 2002-09-26 04:41:55 +00:00
Peter Eisentraut 49c86099f3 Shrink the pg_hba.conf and pg_ident.conf default files and move most of the
inline documentation to the main docs.
2002-09-14 18:35:46 +00:00
Tom Lane 3f63787cbf Guard against send-lots-and-lots-of-data DoS attack from unauthenticated
users, by limiting the length of string we will accept for a password.
Patch by Serguei Mokhov, some editorializing by Tom Lane.
2002-09-04 23:31:35 +00:00
Bruce Momjian e50f52a074 pgindent run. 2002-09-04 20:31:48 +00:00
Peter Eisentraut 77f7763b55 Remove all traces of multibyte and locale options. Clean up comments
referring to "multibyte" where it really means character encoding.
2002-09-03 21:45:44 +00:00
Bruce Momjian 97ac103289 Remove sys/types.h in files that include postgres.h, and hence c.h,
because c.h has sys/types.h.
2002-09-02 02:47:07 +00:00
Bruce Momjian f7e089b3fa Back out password packet length check.
Improve wording of pre-7.3 syntax mention.
2002-08-30 16:00:41 +00:00