1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-25 12:03:53 +03:00
Commit Graph

14516 Commits

Author SHA1 Message Date
Bruce Momjian
b25ddbb81e 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:51 +00:00
Bruce Momjian
68b856f065 Stamp releases 7.3.16, 7.4.14, 8.0.9, and 8.1.5. 2006-10-09 23:38:14 +00:00
Bruce Momjian
850f5f3287 Update release notes for releases 7.3.16, 7.4.14, 8.0.9, and 8.1.5. 2006-10-09 23:22:58 +00:00
Tom Lane
a9ae4ae8c1 Fix back-branch pg_regress scripts to try the "canonical" expected file if we
tried a variant file from resultmap and it didn't match.  This is already done
in HEAD's C-code version, and is needed because OpenBSD has recently migrated
to a more standard handling of float underflow --- see buildfarm results
from emu.
2006-10-09 01:46:04 +00:00
Tom Lane
4e66f619b0 Fix ancient oversight in psql's \d pattern processing code: when seeing two
quote chars inside quote marks, should emit one quote *and stay in inquotes
mode*.  No doubt the lack of reports of this have something to do with the
poor documentation of the feature ...
2006-10-07 22:22:04 +00:00
Tom Lane
152dbad1eb Clean up rather sloppy fix in HEAD for the ancient bug that CREATE CONVERSION
didn't create a dependency from the new conversion to its schema.  Back-patch
to all supported releases.
2006-08-31 17:32:01 +00:00
Teodor Sigaev
2b3d2717c4 Fix bug introduced by last patch, thanks again to Mario Weilguni <mweilguni@sime.com> 2006-08-08 15:46:31 +00:00
Teodor Sigaev
3da93a0a3b fix bug about modifying value in shared buffer,
what was a reason to corrupt index.
Thank to Mario Weilguni <mweilguni@sime.com> to
discover a bug.
2006-08-07 17:42:54 +00:00
Neil Conway
3c3c610c57 A recent backpatch to 7.3's contrib/ltree got mixed up, putting code in
the wrong place.  This moves it to the right place which allows it to
compile. Patch from Kris Jurka.
2006-07-14 00:32:46 +00:00
Teodor Sigaev
79aabd140d Fix bug corrupting query in gist consistent function.
Thank to Mario Weilguni <mweilguni@sime.com> to discover a bug.
2006-07-11 16:11:06 +00:00
Bruce Momjian
4587cd4280 Fix dbmirror for new backslash escaping:
Martin Pitt [2006-06-16  0:15 +0200]:
> Upstream confirmed my reply in the last mail in [1]: the complete
> escaping logic in DBMirror.pl is seriously screwew.
>
> [1] http://archives.postgresql.org/pgsql-bugs/2006-06/msg00065.php

I finally found some time to debug this, and I think I found a better
patch than the one you proposed. Mine is still hackish and is still a
workaround around a proper quoting solution, but at least it repairs
the parsing without introducing the \' quoting again.

I consider this a band-aid patch to fix the recent security update.
PostgreSQL gurus, would you consider applying this until a better
solution is found for DBMirror.pl?

Martin Pitt        http://www.piware.de
2006-07-06 02:02:36 +00:00
Tom Lane
fe090f0778 Back-patch 7.4-era fix for memory leak with SSL connections due to
missing X509_free() calls.  Per a request from a Red Hat customer;
seems silly for Red Hat to be shipping a patch that's not in upstream.
2006-06-23 14:42:52 +00:00
Tom Lane
9e63275633 Back-port Postgres 7.4 spinlock code into 7.3 branch. This adds
previously-missing spinlock code for x86_64 and ppc64 architectures,
converts the ppc/ppc64 code into gcc inlines, and provides a better
spinlock backoff algorithm on all architectures.  Aside from being
almost identical to the community 7.4 source code, this exact patch
has been in use for awhile in Red Hat's RHEL3 RPMs, so I have pretty
good confidence in it.  Why bother, you ask?  I'm taking pity on a
couple of buildfarm members that have been vainly trying to build 7.3
on these 64-bit architectures.
2006-06-01 23:18:11 +00:00
Tom Lane
7769196fb5 Pre-8.0 branches need to cope with possibility that the system libc knows
about the recent changes in US DST law.  Add a variant horology file, so
that either the old or new rules will be considered valid test results.
2006-06-01 04:10:33 +00:00
Tom Lane
e675978ff5 Stamp release 7.3.15. REL7_3_15 2006-05-21 21:54:31 +00:00
Tom Lane
78e237e1e3 Update release notes for upcoming releases. 2006-05-21 21:50:14 +00:00
Bruce Momjian
502b68876c Stamp releases 7.3.15, 7.4.13, and 8.0.8. 2006-05-21 20:28:22 +00:00
Tom Lane
e6f43f7786 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:48 +00:00
Tom Lane
16e77740ea Add a new GUC parameter backslash_quote, which determines whether the SQL
parser will allow "\'" to be used to represent a literal quote mark.  The
"\'" representation has been deprecated for some time in favor of the
SQL-standard representation "''" (two single quote marks), but it has been
used often enough that just disallowing it immediately won't do.  Hence
backslash_quote allows the settings "on", "off", and "safe_encoding",
the last meaning to allow "\'" only if client_encoding is a valid server
encoding.  That is now the default, and the reason is that in encodings
such as SJIS that allow 0x5c (ASCII backslash) to be the last byte of a
multibyte character, accepting "\'" allows SQL-injection attacks as per
CVE-2006-2314 (further details will be published after release).  The
"on" setting is available for backward compatibility, but it must not be
used with clients that are exposed to untrusted input.

Thanks to Akio Ishida and Yasuo Ohgaki for identifying this security issue.
2006-05-21 20:12:20 +00:00
Tom Lane
5c4de67044 Change the backend to reject strings containing invalidly-encoded multibyte
characters in all cases.  Formerly we mostly just threw warnings for invalid
input, and failed to detect it at all if no encoding conversion was required.
The tighter check is needed to defend against SQL-injection attacks as per
CVE-2006-2313 (further details will be published after release).  Embedded
zero (null) bytes will be rejected as well.  The checks are applied during
input to the backend (receipt from client or COPY IN), so it no longer seems
necessary to check in textin() and related routines; any string arriving at
those functions will already have been validated.  Conversion failure
reporting (for characters with no equivalent in the destination encoding)
has been cleaned up and made consistent while at it.

Also, fix a few longstanding errors in little-used encoding conversion
routines: win1251_to_iso, win866_to_iso, euc_tw_to_big5, euc_tw_to_mic,
mic_to_euc_tw were all broken to varying extents.

Patches by Tatsuo Ishii and Tom Lane.  Thanks to Akio Ishida and Yasuo Ohgaki
for identifying the security issues.
2006-05-21 20:07:13 +00:00
Bruce Momjian
583a472f7b Change \' to '', for SQL standards compliance. Backpatch to 7.3, 7.4,
and 8.0.  Later releases already patched.
2006-05-21 19:56:41 +00:00
Tom Lane
506747337b Fix the sense of the test on DH_check()'s return value. This was preventing
custom-generated DH parameters from actually being used by the server.
Found by Michael Fuhr.
2006-05-12 22:45:06 +00:00
Tom Lane
76dc24091f Remove unnecessary .seg/.section directives, per Alan Stange. 2006-05-11 22:00:12 +00:00
Tom Lane
803d61a353 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:16:08 +00:00
Tatsuo Ishii
342fae3dc5 Minor teak. 2006-03-04 12:35:08 +00:00
Tatsuo Ishii
52c4e32d5f Tighten up SJIS byte sequence check. Now we reject invalid SJIS byte
sequence such as "0x95 0x27". Patches from Akio Ishida.
2006-03-04 12:32:59 +00:00
Neil Conway
11b3472672 Fix three Python reference leaks in PLy_traceback(). This would result
in leaking memory when invoking a PL/Python procedure that raises an
exception. Unfortunately this still leaks memory, but at least the
largest leak has been plugged.

This patch also fixes a reference counting mistake in PLy_modify_tuple()
for 8.0, 8.1 and HEAD: we don't actually own a reference to `platt', so
we shouldn't Py_DECREF() it.
2006-02-20 20:10:48 +00:00
Neil Conway
0c853662bd Patch from Marko Kreen:
pgcrypto crypt()/md5 and hmac() leak memory when compiled against
OpenSSL as openssl.c digest ->reset will do two DigestInit calls
against a context.  This happened to work with OpenSSL 0.9.6
but not with 0.9.7+.

Reason for the messy code was that I tried to avoid creating
wrapper structure to transport algorithm info and tried to use
OpenSSL context for it.  The fix is to create wrapper structure.

It also uses newer digest API to avoid memory allocations
on reset with newer OpenSSLs.

Thanks to Daniel Blaisdell for reporting it.
2006-02-18 20:49:02 +00:00
Tom Lane
eb46ad568d Stamp 7.3.14. REL7_3_14 2006-02-12 22:38:54 +00:00
Tom Lane
ee7c1a3fd4 Update release notes. 2006-02-12 22:36:16 +00:00
Tom Lane
118f54d06d Fix bug in SET SESSION AUTHORIZATION that allows unprivileged users to crash
the server, if it has been compiled with Asserts enabled (CVE-2006-0553).
Thanks to Akio Ishida for reporting this problem.
2006-02-12 22:33:47 +00:00
Bruce Momjian
da91fde3e8 Update FAQ latest version 2006-02-12 18:50:07 +00:00
Bruce Momjian
c551fd362e Stamp releases for 2006-02-14 release 2006-02-12 18:41:22 +00:00
Bruce Momjian
db4534e31f Update release notes for 2006-02-14 release 2006-02-12 18:23:00 +00:00
Tom Lane
3cbc8b6fb4 Repair longstanding bug in slru/clog logic: it is possible for two backends
to try to create a log segment file concurrently, but the code erroneously
specified O_EXCL to open(), resulting in a needless failure.  Before 7.4,
it was even a PANIC condition :-(.  Correct code is actually simpler than
what we had, because we can just say O_CREAT to start with and not need a
second open() call.  I believe this accounts for several recent reports of
hard-to-reproduce "could not create file ...: File exists" errors in both
pg_clog and pg_subtrans.
2006-01-21 04:38:54 +00:00
Tom Lane
a6cc7db9a6 Repair "Halloween problem" in EvalPlanQual: a tuple that's been inserted by
our own command (or more generally, xmin = our xact and cmin >= current
command ID) should not be seen as good.  Else we may try to update rows
we already updated.  This error was inserted last August while fixing the
even bigger problem that the old coding wouldn't see *any* tuples inserted
by our own transaction as good.  Per report from Euler Taveira de Oliveira.
2006-01-12 21:49:41 +00:00
Tom Lane
158c7f32b4 Use a more bulletproof test for whether finite() and isinf() are present.
It seems that recent gcc versions can optimize away calls to these functions
even when the functions do not exist on the platform, resulting in a bogus
positive result.  Avoid this by using a non-constant argument and ensuring
that the function result is not simply discarded.  Per report from
François Laupretre.
2006-01-12 19:24:48 +00:00
Tom Lane
b4feb29e0d Fix pg_dump to add the required OPERATOR() decoration to schema-qualified
operator names.  This is needed when dumping operator definitions that have
COMMUTATOR (or similar) links to operators in other schemas.
Apparently Daniel Whitter is the first person ever to try this :-(
2006-01-09 21:16:57 +00:00
Tom Lane
88f2145326 Fix failure to apply domain constraints to a NULL constant that's added to
an INSERT target list during rule rewriting.  Per report from John Supplee.
2006-01-06 20:11:36 +00:00
Tom Lane
751c4818bf Release-note updates and copy editing. REL7_3_13 2006-01-06 03:00:46 +00:00
Tom Lane
d3e91bd475 Generate back-branch configure scripts with the appropriate version of autoconf. 2006-01-06 02:31:25 +00:00
Bruce Momjian
a93eb7cef2 New pgcrypto item wording. 2006-01-05 15:17:08 +00:00
Bruce Momjian
e6e13b5da9 Wording improvements. 2006-01-05 15:11:07 +00:00
Bruce Momjian
7251950412 Improve markup. 2006-01-05 14:52:40 +00:00
Bruce Momjian
00214b611c *** empty log message *** 2006-01-05 05:21:40 +00:00
Bruce Momjian
44a3ad2ab0 Stamp release 7.3.13. 2006-01-05 03:59:21 +00:00
Tom Lane
040d3e63a7 Arrange to set the LC_XXX environment variables to match our locale setup.
Back-patch of previous fix in HEAD for plperl-vs-locale issue.
2006-01-05 00:55:36 +00:00
Tom Lane
3abc36786b Add port support for unsetenv() in back branches. Needed for locale
environment fix.
2006-01-05 00:51:52 +00:00
Joe Conway
4e0f51f13d When the remote query result has a different number of columns
than the local query specifies (e.g. in the FROM clause),
throw an ERROR (instead of crashing). Fix for bug #2129 reported
by Akio Iwaasa.
2006-01-03 23:48:42 +00:00
Tom Lane
a74dc12416 There is a signedness bug in Openwall gen_salt code that pgcrypto uses.
This makes the salt space for md5 and xdes algorithms a lot smaller than
it should be.

Marko Kreen
2006-01-03 23:46:56 +00:00