Commit Graph

844 Commits

Author SHA1 Message Date
Tom Lane dbf859c711 Still more .gitignore cleanup.
Fix overly-enthusiastic ignores, as identified by
git ls-files -i --exclude-standard
2010-09-24 13:48:47 -04:00
Tom Lane ec8576114f Some more gitignore cleanups: cover contrib and PL regression test outputs.
Also do some further work in the back branches, where quite a bit wasn't
covered by Magnus' original back-patch.
2010-09-22 17:22:31 -04:00
Magnus Hagander 6b4453fd71 Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:22 +02:00
Tom Lane 873b9b8a3d Fix dblink_build_sql_insert() and related functions to handle dropped
columns correctly.  In passing, get rid of some dead logic in the
underlying get_sql_insert() etc functions --- there is no caller that
will pass null value-arrays to them.

Per bug report from Robert Voinea.
2010-06-15 19:04:59 +00:00
Tom Lane 240076b3c4 Consolidate and improve checking of key-column-attnum arguments for
dblink_build_sql_insert() and related functions.  In particular, be sure to
reject references to dropped and out-of-range column numbers.  The numbers
are still interpreted as physical column numbers, though, for backward
compatibility.

This patch replaces Joe's patch of 2010-02-03, which handled only some aspects
of the problem.
2010-06-15 16:22:58 +00:00
Tom Lane 5ab2c669cb Rearrange dblink's dblink_build_sql_insert() and related routines to open and
lock the target relation just once per SQL function call.  The original coding
obtained and released lock several times per call.  Aside from saving a
not-insignificant number of cycles, this eliminates possible race conditions
if someone tries to modify the relation's schema concurrently.  Also
centralize locking and permission-checking logic.

Problem noted while investigating a trouble report from Robert Voinea --- his
problem is still to be fixed, though.
2010-06-14 20:50:11 +00:00
Itagaki Takahiro 6742c60153 Fix incorrect change in dblink introduced by the previous commit
"Fix connection leak in dblink".
2010-06-10 00:42:34 +00:00
Itagaki Takahiro 71dca6e000 Fix connection leak in dblink when dblink_connect() or dblink_connect_u()
end with "duplicate connection name" errors.

Backported to release 7.4.
2010-06-09 01:00:50 +00:00
Tom Lane 2154452ca4 Ensure that contrib/pgstattuple functions respond to cancel interrupts
reasonably promptly, by adding CHECK_FOR_INTERRUPTS in the per-page loops.

Tatsuhito Kasahara
2010-04-02 16:17:31 +00:00
Joe Conway a0b3d52af1 Check to ensure the number of primary key fields supplied does not
exceed the total number of non-dropped source table fields for
dblink_build_sql_*(). Addresses bug report from Rushabh Lathia.

Backpatch all the way to the 7.3 branch.
2010-02-03 23:02:28 +00:00
Magnus Hagander 65face6a12 Remove beer-ware license from crypt-md5.c, per
approval from Poul-Henning Kamp.

This makes the file the same standard 2-clause BSD as the
rest of PostgreSQL.
2009-04-15 18:58:26 +00:00
Teodor Sigaev ca1316dfa3 Fix 'all at one page bug' in picksplit method of R-tree emulation. Add defense
from buggy user-defined picksplit to GiST.
2009-04-07 17:49:40 +00:00
Tom Lane 1b40567c55 Defend against non-ASCII letters in fuzzystrmatch code. The functions
still don't behave very sanely for multibyte encodings, but at least
they won't be indexing off the ends of static arrays.
2009-04-07 15:54:30 +00:00
Tom Lane ed00200dac Fix contrib/pgstattuple and contrib/pageinspect to prevent attempts to read
temporary tables of other sessions; that is unsafe because of the way our
buffer management works.  Per report from Stuart Bishop.
This is redundant with the bufmgr.c checks in HEAD, but not at all redundant
in the back branches.
2009-03-31 22:56:28 +00:00
Teodor Sigaev d01bcba483 Fix uninitialized variables in get_covers 2009-01-16 12:10:34 +00:00
Teodor Sigaev e0408ba3d5 Fix URL generation in headline. Only tag lexeme will be replaced by space.
Per http://archives.postgresql.org/pgsql-bugs/2008-12/msg00013.php
2009-01-15 18:30:10 +00:00
Teodor Sigaev f58cccb0b5 Fix generation of too long headline with ShortWords.
Per http://archives.postgresql.org/pgsql-hackers/2008-09/msg01088.php
2009-01-15 18:29:47 +00:00
Teodor Sigaev ca2ecbdaca Fix small bug in headline generation.
Patch from Sushant Sinha <sushant354@gmail.com>
http://archives.postgresql.org/pgsql-hackers/2008-07/msg00785.php
2008-10-17 17:44:15 +00:00
Tom Lane 29cb46fa77 Fix several datatype input functions that were allowing unused bytes in their
results to contain uninitialized, unpredictable values.  While this was okay
as far as the datatypes themselves were concerned, it's a problem for the
parser because occurrences of the "same" literal might not be recognized as
equal by datumIsEqual (and hence not by equal()).  It seems sufficient to fix
this in the input functions since the only critical use of equal() is in the
parser's comparisons of ORDER BY and DISTINCT expressions.
Per a trouble report from Marc Cousin.

Patch all the way back.  Interestingly, array_in did not have the bug before
8.2, which may explain why the issue went unnoticed for so long.
2008-04-11 22:53:33 +00:00
Tom Lane 1f42e1cb68 The original patch to disallow non-passworded connections to non-superusers
failed to cover all the ways in which a connection can be initiated in dblink.
Plug the remaining holes.  Also, disallow transient connections in functions
for which that feature makes no sense (because they are only sensible as
part of a sequence of operations on the same connection).  Joe Conway

Security: CVE-2007-6601
2008-01-03 21:28:55 +00:00
Teodor Sigaev 505292eb41 Backpatch: Fix tsvector_out() and tsquery_out() to escape backslesh, add test of that.
Patch by Bruce Momjian <bruce@momjian.us>
2007-11-16 17:31:16 +00:00
Joe Conway 8145f00f27 Have crosstab variants treat NULL rowid as a category in its own right,
per suggestion from Tom Lane. This fixes crash-bug reported by Stefan
Schwarzer.
2007-11-10 05:02:22 +00:00
Teodor Sigaev 45cd13c8ab Fix crash of to_tsvector() function on huge input: compareWORD()
function didn't return correct result for word position greate than
limit.

Per report from Stuart Bishop <stuart@stuartbishop.net>
2007-09-26 10:44:54 +00:00
Tom Lane 08e72a644a Fix combo_decrypt() to throw an error for zero-length input when using a
padded encryption scheme.  Formerly it would try to access res[(unsigned) -1],
which resulted in core dumps on 64-bit machines, and was certainly trouble
waiting to happen on 32-bit machines (though in at least the known case
it was harmless because that byte would be overwritten after return).
Per report from Ken Colson; fix by Marko Kreen.
2007-08-23 16:16:20 +00:00
Joe Conway 62ca8db433 Restrict non-superusers to password authenticated connections
to prevent possible escalation of privilege. Provide new SECURITY
DEFINER functions with old behavior, but initially REVOKE ALL
from public for these functions. Per list discussion and design
proposed by Tom Lane.
2007-07-09 01:43:57 +00:00
Teodor Sigaev a75602e4c6 Fix caching of unsuccessful initialization of parser or configuration.
Per report from Listmail <lists@peufeu.com>
2007-04-02 11:43:30 +00:00
Teodor Sigaev bcac5703ec Fix backend crash in parsing incorrect tsquery.
Per report from Jon Rosebaugh <jon@inklesspen.com>
2007-02-12 14:19:26 +00:00
Tatsuo Ishii fe7b0fc35d Back port patch.
Call srandom() instead of srand().
pgbench calls random() later, so it should have called srandom().
On most platforms except Windows srandom() is actually identical
to srand(), so the bug only bites Windows users.
per bug report from Akio Ishida.
2007-01-13 03:24:55 +00:00
Teodor Sigaev 3672084fe6 Fix bug introduced by last patch, thanks again to Mario Weilguni <mweilguni@sime.com> 2006-08-08 15:46:09 +00:00
Teodor Sigaev 8f0b1d044c 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:12 +00:00
Teodor Sigaev 2962428b3a Fix bug corrupting query in gist consistent function.
Thank to Mario Weilguni <mweilguni@sime.com> to discover a bug.
2006-07-11 16:09:47 +00:00
Bruce Momjian 24ccd11a6c 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:48 +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
Teodor Sigaev e314c3f53f Detoast query in g_intbig_consistent and copy query in g_int_consistent.
Minor cleanups.
2006-04-03 10:27:28 +00:00
Neil Conway ac2172d6f6 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:00 +00:00
Joe Conway fcacfc96a2 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:04 +00:00
Tom Lane 8dc7c8cf1d 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:51 +00:00
Teodor Sigaev 9e4caa5abe Fix stupid bug with sizeof 2005-12-06 18:22:13 +00:00
Tom Lane 01145f963f Prevent core dump in contrib version of autovacuum when a table has been
dropped.  Per report from daveg (not his patch, though).
2005-10-20 16:14:47 +00:00
Teodor Sigaev 8fb4451a4d Update Snowball. I have to update it because of
old version doesn't available on Snowball's site and new version
of stemmers can't be compiled with old interface.
2005-09-15 12:41:52 +00:00
Tom Lane 6f0da9545a int_array_enum function should be using fcinfo->flinfo->fn_extra for
working state, not fcinfo->context.  Silly oversight on my part in last
go-round of fixes.
2005-08-15 19:05:43 +00:00
Tom Lane dc59b47518 cube_1 variant is needed in 7.4 branch, per results from buildfarm
machine 'kudu'.
2005-07-16 20:11:12 +00:00
Tom Lane 0a719d8935 Fix bogus "extern int errno;" in back branches, per Andrew Dunstan. 2005-07-16 15:23:29 +00:00
Teodor Sigaev 1891938e9c Prevent to divide by zero and range out of 0..1 2005-06-01 11:46:09 +00:00
Tom Lane 308f01c304 Change tsearch2 to not use the unsafe practice of creating functions
that return INTERNAL without also having INTERNAL arguments.  Since the
functions in question aren't meant to be called by hand anyway, I just
redeclared them to take 'internal' instead of 'text'.  Also add code
to ProcedureCreate() to enforce the restriction, as I should have done
to start with :-(
2005-05-03 16:51:45 +00:00
Tom Lane c7b94bbad9 int_aggregate's int_enum() doesn't work correctly with arrays that
aren't 1-D, so give an error message instead of failing.  Per report
from Ron Mayer.
2005-04-23 05:39:01 +00:00
Teodor Sigaev 6091d62c9d Add comment about permissions on pg_ts* tables 2005-04-19 13:59:06 +00:00
Teodor Sigaev 7d19650a79 Fix various comparing functions 2005-03-31 15:12:08 +00:00
Tom Lane b4fd104204 Previous "64-bit fix" for intagg didn't actually work. This is already
fixed properly in CVS tip, but we need a band-aid for back branches.
Per report from Ron Mayer.
2005-03-23 19:07:03 +00:00
Neil Conway 2450224e6b Some builds (depends on crypto engine support?) of OpenSSL
0.9.7x have EVP_DigestFinal function which which clears all of
EVP_MD_CTX.  This makes pgcrypto crash in functions which
re-use one digest context several times: hmac() and crypt()
with md5 algorithm.

Following patch fixes it by carring the digest info around
EVP_DigestFinal and re-initializing cipher.

Marko Kreen.
2005-03-12 06:55:14 +00:00