Commit graph

2427 commits

Author SHA1 Message Date
Magnus Hagander
6b4453fd71 Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:22 +02:00
Marc G. Fournier
ab9536b134 tag 7.4.29 2010-05-14 03:44:21 +00:00
Peter Eisentraut
e2740649a0 Translation update 2010-05-13 07:05:04 +00:00
Tom Lane
47bdd80dc1 Work around a subtle portability problem in use of printf %s format.
Depending on which spec you read, field widths and precisions in %s may be
counted either in bytes or characters.  Our code was assuming bytes, which
is wrong at least for glibc's implementation, and in any case libc might
have a different idea of the prevailing encoding than we do.  Hence, for
portable results we must avoid using anything more complex than just "%s"
unless the string to be printed is known to be all-ASCII.

This patch fixes the cases I could find, including the psql formatting
failure reported by Hernan Gonzalez.  In HEAD only, I also added comments
to some places where it appears safe to continue using "%.*s".
2010-05-08 16:40:52 +00:00
Marc G. Fournier
249271d387 tag 7.4.28 2010-03-12 04:06:01 +00:00
Tom Lane
f82e8e7f6f Fix a couple of places that would loop forever if attempts to read a stdio file
set ferror() but never set feof().  This is known to be the case for recent
glibc when trying to read a directory as a file, and might be true for other
platforms/cases too.  Per report from Ed L.  (There is more that we ought to
do about his report, but this is one easily identifiable issue.)
2010-03-03 20:31:50 +00:00
Marc G. Fournier
df4b86a004 tag 7.4.27 2009-12-10 03:26:04 +00:00
Magnus Hagander
5293cc8eb9 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:09 +00:00
Tom Lane
b8218dcfa2 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:26:17 +00:00
Marc G. Fournier
ef31ff159f Tag 7.4.26 2009-09-04 05:33:18 +00:00
Peter Eisentraut
8422728a2b Translation updates 2009-09-03 18:49:05 +00:00
Marc G. Fournier
e3c0d679dc tag 7.4.25 2009-03-13 02:39:42 +00:00
Marc G. Fournier
cedefbdf13 tag 7.4.24 2009-01-30 03:54:33 +00:00
Magnus Hagander
d8b324ebd8 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:48 +00:00
Marc G. Fournier
31f6cfb690 tag 7.4.23 2008-10-31 03:15:21 +00:00
Peter Eisentraut
3b5767cba7 Translation updates 2008-10-30 19:19:35 +00:00
Michael Meskes
74f7c8e4d6 Optional argument should be optional. 2008-10-10 12:19:03 +00:00
Marc G. Fournier
b304b8640b tag for 7.4.22 2008-09-19 03:30:27 +00:00
Tom Lane
33266e0716 Stamp 7.4.21 (except for configure.in/configure) 2008-06-08 22:15:45 +00:00
Tom Lane
fd3a83436a Stamp 7.4.20 (except for configure.in/configure) 2008-06-05 23:56:42 +00:00
Tom Lane
ad37d9e46a Translation updates. 2008-06-05 23:38:03 +00:00
Michael Meskes
a27b961a0c Fixed bug in PGTYPEStimestamp_sub that used pointers instead of the values to substract. 2008-04-10 10:46:56 +00:00
Tom Lane
d85096ce12 Fix an ancient oversight in libpq's handling of V3-protocol COPY OUT mode:
we need to be able to swallow NOTICE messages, and potentially also
ParameterStatus messages (although the latter would be a bit weird),
without exiting COPY OUT state.  Fix it, and adjust the protocol documentation
to emphasize the need for this.  Per off-list report from Alexander Galler.
2008-01-14 18:46:49 +00:00
Tom Lane
56a2a41763 Stamp release 7.4.19.
Security: CVE-2007-4769, CVE-2007-4772, CVE-2007-6067, CVE-2007-6600, CVE-2007-6601
2008-01-03 21:42:17 +00:00
Michael Meskes
ebec2bac88 Added missing clause to parser. 2007-11-06 08:33:32 +00:00
Peter Eisentraut
93bba446ce Translation updates 2007-09-13 20:56:32 +00:00
Bruce Momjian
59f7d47ed7 Stamp releases 8.2.5, 8.1.10, 8.0.14, 7.4.18, 7.3.20.
Update FAQs for 8.2.5.
2007-09-11 17:36:45 +00:00
Magnus Hagander
ff392ec8db The proper guaranteed buffer size for errors is
INITIAL_EXPBUFFER_SIZE, not PQERRORMSG_LENGTH.

Backport only - the proper fix in HEAD is to
use PQExpBuffers everywhere.
2007-07-23 18:10:13 +00:00
Bruce Momjian
f199177461 Stamp releases 8.2.4, 8.1.9, 8.0.13, 7.4.17, 7.3.19. 2007-04-19 03:06:37 +00:00
Michael Meskes
b128f53343 Backported bug fix for #2956. 2007-02-27 13:26:50 +00:00
Tom Lane
de59c01f26 Stamp release 7.4.16.
Security: CVE-2007-0555, CVE-2007-0556
2007-02-02 00:15:35 +00:00
Peter Eisentraut
65ada7c810 Translation updates 2007-01-31 08:12:56 +00:00
Bruce Momjian
37a86cd254 Stamp release 7.4.15. 2007-01-05 20:53:11 +00:00
Bruce Momjian
f3fa771ccf Update libpq.rc for 7.3.16 and 7.4.14. Later releases use libpq.rc.in,
which was already updated.
2006-10-10 00:19:58 +00:00
Michael Meskes
9e6815ef0f Do not use already free'ed errmsg, bug found by Joachim Wieland
<joachim.wieland@credativ.de>
2006-06-19 09:20:32 +00:00
Michael Meskes
8fc6b3dbf3 Fixed two memory leaks in ecpglib. 2006-06-06 11:36:00 +00:00
Bruce Momjian
5421969f72 Stamp releases 7.3.15, 7.4.13, and 8.0.8. 2006-05-21 20:28:26 +00:00
Tom Lane
96871fc236 Modify libpq's string-escaping routines to be aware of encoding considerations
and standard_conforming_strings.  The encoding changes are needed for proper
escaping in multibyte encodings, as per the SQL-injection vulnerabilities
noted in CVE-2006-2313 and CVE-2006-2314.  Concurrent fixes are being applied
to the server to ensure that it rejects queries that may have been corrupted
by attempted SQL injection, but this merely guarantees that unpatched clients
will fail rather than allow injection.  An actual fix requires changing the
client-side code.  While at it we have also fixed these routines to understand
about standard_conforming_strings, so that the upcoming changeover to SQL-spec
string syntax can be somewhat transparent to client code.

Since the existing API of PQescapeString and PQescapeBytea provides no way to
inform them which settings are in use, these functions are now deprecated in
favor of new functions PQescapeStringConn and PQescapeByteaConn.  The new
functions take the PGconn to which the string will be sent as an additional
parameter, and look inside the connection structure to determine what to do.
So as to provide some functionality for clients using the old functions,
libpq stores the latest encoding and standard_conforming_strings values
received from the backend in static variables, and the old functions consult
these variables.  This will work reliably in clients using only one Postgres
connection at a time, or even multiple connections if they all use the same
encoding and string syntax settings; which should cover many practical
scenarios.

Clients that use homebrew escaping methods, such as PHP's addslashes()
function or even hardwired regexp substitution, will require extra effort
to fix :-(.  It is strongly recommended that such code be replaced by use of
PQescapeStringConn/PQescapeByteaConn if at all feasible.
2006-05-21 20:20:24 +00:00
Bruce Momjian
48498602a0 Change \' to '', for SQL standards compliance. Backpatch to 7.3, 7.4,
and 8.0.  Later releases already patched.
2006-05-21 19:57:07 +00:00
Michael Meskes
1d18949563 Fixed memory leak bugs found by Martijn Oosterhout. 2006-04-24 09:46:32 +00:00
Tom Lane
8a3789cdfa Fix ancient memory leak in PQprintTuples(); our code no longer uses this
routine, but perhaps some applications do.  Found by Martijn van Oosterhout
using Coverity.
2006-04-19 16:15:52 +00:00
Michael Meskes
ac2c2a457f Fixed bug 2330: Wrong error code in case of a duplicate key 2006-03-19 12:32:13 +00:00
Bruce Momjian
81c303c514 Stamp releases for 2006-02-14 release 2006-02-12 18:41:39 +00:00
Bruce Momjian
12693c6476 Stamp release 7.4.11. 2006-01-05 03:59:48 +00:00
Neil Conway
bf8128f757 Remove DOS line endings ("\r\n") from several .po files. DOS line endings
are inconsistent with the rest of the .po files, and apparently cause
problems for Sun's cc. Per report on IRC from "bitvector2".
2006-01-01 10:14:27 +00:00
Tom Lane
9c8c45e218 Stamp 7.4.10. 2005-12-09 20:53:26 +00:00
Bruce Momjian
e257f28db0 [ Backpatch to 7.4.X.]
Also I fixed a bug in a bug fix I committed a few weeks ago. he check
for a varchar pointer was incomplete.

Michael Meskes
2005-10-14 01:50:58 +00:00
Tom Lane
4082f5e34f Stamp release 7.4.9. 2005-10-03 17:14:24 +00:00
Michael Meskes
d00f6b249a - Check for NULL before checking whether argument is an array.
- Removed stray character from string quoting.
	- Fixed check to report missing varchar pointer implementation.
2005-08-24 10:35:54 +00:00
Tom Lane
6ec28d8503 ecpglib depends on last_path_separator from src/port/path.c, so we'd
better include that in the library build.  This was fixed in 8.0 and
later, backport to 7.4 to fix buildfarm failure.
2005-07-16 20:39:24 +00:00