Commit graph

3078 commits

Author SHA1 Message Date
Tom Lane
a6d3ec103b Set errno to zero before invoking SSL_read or SSL_write. It appears that
at least in some Windows versions, these functions are capable of returning
a failure indication without setting errno.  That puts us into an infinite
loop if the previous value happened to be EINTR.  Per report from Brendan
Hill.

Back-patch to 8.2.  We could take it further back, but since this is only
known to be an issue on Windows and we don't support Windows before 8.2,
it does not seem worth the trouble.
2009-12-30 03:46:01 +00:00
Marc G. Fournier
f25013104a tag 8.3.9 2009-12-10 03:02:07 +00:00
Magnus Hagander
d724237551 Reject certificates with embedded NULLs in the commonName field. This stops
attacks where an attacker would put <attack>\0<propername> in the field and
trick the validation code that the certificate was for <attack>.

This is a very low risk attack since it reuqires the attacker to trick the
CA into issuing a certificate with an incorrect field, and the common
PostgreSQL deployments are with private CAs, and not external ones. Also,
default mode in 8.4 does not do any name validation, and is thus also not
vulnerable - but the higher security modes are.

Backpatch all the way. Even though versions 8.3.x and before didn't have
certificate name validation support, they still exposed this field for
the user to perform the validation in the application code, and there
is no way to detect this problem through that API.

Security: CVE-2009-4034
2009-12-09 06:37:25 +00:00
Tom Lane
a15cb0652f Remove outside-the-scanner references to "yyleng".
It seems the flex developers have decided to change yyleng from int to size_t.
This has already happened in the latest release of OS X, and will start
happening elsewhere once the next release of flex appears.  Rather than trying
to divine how it's declared in any particular build, let's just remove the one
existing not-very-necessary external usage.

Back-patch to all supported branches; not so much because users in the field
are likely to care about building old branches with cutting-edge flex, as
to keep OSX-based buildfarm members from having problems with old branches.
2009-09-08 04:25:25 +00:00
Marc G. Fournier
e01fdca9f7 Tag 8.3.8 2009-09-04 00:53:29 +00:00
Peter Eisentraut
095f7ba339 Translation updates 2009-09-03 19:25:46 +00:00
Marc G. Fournier
c87a4d31f4 tag 8.3.7 2009-03-13 02:08:41 +00:00
Marc G. Fournier
5298d511ee tag for 8.3.6 2009-01-30 02:59:29 +00:00
Magnus Hagander
20632d57f1 Go over all OpenSSL return values and make sure we compare them
to the documented API value. The previous code got it right as
it's implemented, but accepted too much/too little compared to
the API documentation.

Per comment from Zdenek Kotala.
2009-01-28 15:06:57 +00:00
Michael Meskes
0b1953868e Replaced strchrnul by strchr. 2008-11-26 15:37:01 +00:00
Michael Meskes
c892504fa6 When creating a varchar struct name braces must be discarded. 2008-11-26 13:19:34 +00:00
Marc G. Fournier
a06dedfc5e commit for 8.3.5 2008-10-31 02:38:34 +00:00
Magnus Hagander
13a7d7f3cc Fix memory leak when using gsslib parameter in libpq connections 2008-10-23 16:17:22 +00:00
Michael Meskes
603972f3e0 Optional arguments should be optional. 2008-10-10 12:20:06 +00:00
Magnus Hagander
3862493ad3 Link libpq with libgssapi if configure finds it, as
required by at least NetBSD.

Markus Schaaf
2008-10-01 15:35:34 +00:00
Marc G. Fournier
63aa5e3527 tag for 8.3.4 2008-09-19 03:04:13 +00:00
Tom Lane
8208fbb4ce Avoid using sprintf() for a simple octal conversion in PQescapeByteaInternal.
Improves performance, per suggestion from Rudolf Leitgeb (bug #4414).
The backend did this right already, but not libpq.
2008-09-10 17:01:17 +00:00
Michael Meskes
393dc9bde2 Fixed incorrect argument handling in SET command if argument is a variable. 2008-08-20 14:07:16 +00:00
Magnus Hagander
1852a73c7a Make libpq on windows not try to send chunks larger than 64Kb.
Per Microsoft knowledge base article Q201213, early versions of
Windows fail when we do this. Later versions of Windows appear
to have a higher limit than 64Kb, but do still fail on large
sends, so we unconditionally limit it for all versions.

Patch from Tom Lane.
2008-08-20 11:53:51 +00:00
Bruce Momjian
36985c52f4 Synchronize Borland libpq makefile to match MSVC. Backpatch to 8.3.X. 2008-08-16 01:56:25 +00:00
Alvaro Herrera
aae91a5055 Add MSVC++ debug libraries to .cvsignore. 2008-07-17 21:16:24 +00:00
Magnus Hagander
da747a4e85 Fix standalone libpq build on win32.
Hiroshi Saito
2008-06-27 18:58:16 +00:00
Tom Lane
f1869c79a9 Stamp 8.3.3 (except for configure.in/configure) 2008-06-08 22:14:09 +00:00
Tom Lane
6deaeb3e2b Stamp 8.3.2 (except for configure.in/configure) 2008-06-05 23:55:26 +00:00
Tom Lane
2d2896507b Translation updates. 2008-06-05 23:36:45 +00:00
Michael Meskes
bf3bf909a5 Added symbol SQL to list of allowed variables. 2008-06-04 12:26:14 +00:00
Tom Lane
3ea40a115d Remove unused variable (was already done in HEAD) 2008-06-03 20:55:41 +00:00
Michael Meskes
f496eb31b2 Check for non-existant connection in prepare statement handling.
Do not close files that weren't opened.
2008-05-12 16:30:17 +00:00
Magnus Hagander
2804eb27ad Add more dependencies from libpgport required by
standalone msvc build of libpq.

Hiroshi Saito
2008-05-05 19:31:45 +00:00
Andrew Dunstan
547f61f028 Avoid using unnecessary pgwin32_safestat in libpq. 2008-04-16 14:21:23 +00:00
Michael Meskes
4fcff62991 Fixed bug in PGTYPEStimestamp_sub that used pointers instead of the values to substract. 2008-04-10 10:46:22 +00:00
Michael Meskes
e5fab267c5 added ECPGget_PGconn to exports.txt 2008-03-25 12:45:33 +00:00
Michael Meskes
4866b529f3 Corrected version number. 2008-03-21 16:10:10 +00:00
Michael Meskes
94a710563e Added ECPGget_PGconn() function to ecpglib, courtesy of Mike Aubury.
Bumped library version to 6.1.
2008-03-20 16:30:14 +00:00
Michael Meskes
6a78d754d0 Changed statement escaping to not escape continuation line markers.
Bumped precompiler patchlevel.
2008-03-20 16:04:52 +00:00
Tom Lane
eb66892ed6 Stamp version 8.3.1, except for configure.in/configure. 2008-03-13 23:57:34 +00:00
Tom Lane
267d90b82c Include -lgss in libpq link, if available. Bjorn Munch 2008-03-05 05:39:17 +00:00
Michael Meskes
8a7c17d0ee Fixed bug that caused arrays of varchar to be output with incomplete name. 2008-03-02 10:57:21 +00:00
Tom Lane
0b173a6e8d Fix unportable usages of tolower(). On signed-char machines, it is necessary
to explicitly cast the output back to char before comparing it to a char
value, else we get the wrong result for high-bit-set characters.  Found by
Rolf Jentsch.  Also, fix several places where <ctype.h> functions were being
called without casting the argument to unsigned char; this is likewise
unportable, but we keep making that mistake :-(.  These found by buildfarm
member salamander, which I will desperately miss if it ever goes belly-up.
2008-03-01 03:26:44 +00:00
Peter Eisentraut
07e58204ed Fix uninstall target. 2008-02-26 13:49:14 +00:00
Michael Meskes
0ab0607949 Changed INFORMIX mode symbol definition yet again because the old way didn't work on NetBSD. 2008-02-17 18:42:23 +00:00
Michael Meskes
a50a313c1d Updated expected result for regression test. 2008-02-15 18:51:57 +00:00
Michael Meskes
0a96951017 Fixed conflicting commit. 2008-02-15 16:28:47 +00:00
Michael Meskes
bea0466d9d Changed the way symbols are defined in C in INFORMIX mode.
Added SQLSTATE macro closing bug #3961.
EXECUTE can return NOT FOUND so it should be checked here too.
2008-02-15 12:11:02 +00:00
Michael Meskes
fa0dc92fd8 - Fixed segfault in ecpg when using an array element.
- Free all memory in auto-prepare mode.
2008-02-07 11:09:13 +00:00
Tom Lane
cf82aee7ea Fix pg_GSS_error to use conn->errorMessage more sanely, ie, actually
work with the PQExpBuffer code instead of fighting it.  This avoids an
unnecessary limit on message length and fixes the latent bug that
errorMessage.len wasn't getting set.
2008-01-31 18:58:30 +00:00
Peter Eisentraut
3c9ae7300d Translation updates 2008-01-31 18:04:52 +00:00
Peter Eisentraut
6dfa40d69f Translation updates 2008-01-30 11:05:41 +00:00
Tom Lane
5037ed834d Fix up closePGconn() so that PQreset() will work on GSSAPI/SSPI connections;
the patch for those features put its cleanup code into freePGconn() which is
really the wrong place.  Remove redundant code from freePGconn() and add
comments in hopes of preventing similar mistakes in future.
Noticed while trying (futilely) to reproduce bug #3902.
2008-01-29 02:06:30 +00:00
Tom Lane
fad2b99523 Arrange to ignore SIGPIPE during SSL_read() and SSL_shutdown(), as these
are known to write on the socket sometimes and thus we are vulnerable to
being killed by the signal if the server happens to go away unexpectedly.
Noticed while trying (futilely) to reproduce bug #3902.

This bug has been there all along, but since the situation is usually
only of interest to developers, I chose not to back-patch the changes.
2008-01-29 02:03:39 +00:00