1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-06 18:42:54 +03:00
Commit Graph

665 Commits

Author SHA1 Message Date
Joe Conway
c3f8e037c0 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:39 +00:00
Tom Lane
6689ac7db9 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:29:07 +00:00
Joe Conway
75ffb44e7f 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:41 +00:00
Tom Lane
10a81b3f2f 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:27 +00:00
Joe Conway
a776eaea3c 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:44:11 +00:00
Tatsuo Ishii
43021ef815 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:31:12 +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
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
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
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
Teodor Sigaev
85fc9ad4af Fix stupid bug with sizeof 2005-12-06 18:22:09 +00:00
Tom Lane
f739566069 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:58 +00:00
Tom Lane
509741d3d5 Looks like cube_1 variant is also needed in 7.3 branch.
(Don't bother adding it in 7.2, though, since pg_regress doesn't
have the capability to use it that far back.
2005-07-17 17:36:56 +00:00
Tom Lane
24ede218a1 Fix bogus "extern int errno;" in back branches, per Andrew Dunstan. 2005-07-16 15:23:37 +00:00
Tom Lane
ca1e578d62 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:19 +00:00
Tom Lane
ce49ae9041 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:18 +00:00
Neil Conway
acb42e9cb9 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-13 23:45:56 +00:00
Neil Conway
638eb4938c Update contrib/pgcrypto in 7.3 and 7.2 branches to avoid problems with
recent versions of OpenSSL. From Marko Kreen.
2005-03-13 23:41:44 +00:00
Tom Lane
24162978b7 Make sure contrib C functions are marked strict where needed.
Kris Jurka
2005-01-29 22:35:53 +00:00
Tom Lane
64e3271ebc Now that I look at it, int_array_enum() didn't work either. 2005-01-27 21:50:23 +00:00
Tom Lane
05dadca2a0 Fix security and 64-bit issues in contrib/intagg. This code could
stand to be rewritten altogether, but for now just stick a finger in
the dike.
2005-01-27 21:36:10 +00:00
Neil Conway
38ab95f703 Mark the text_soundex() function as "strict", to avoid crashing on NULL
input. Also, may as well mark it "cacheable" as well. From Kris Jurka.
2005-01-26 08:20:40 +00:00
Tom Lane
d9c1e5e1c2 Back-patch make_oidjoins_check security improvement. 2004-10-21 17:12:27 +00:00
Tom Lane
78c0692b15 Repair possible failure to update hint bits back to disk, per
http://archives.postgresql.org/pgsql-hackers/2004-10/msg00464.php.
I plan a more permanent fix in HEAD, but for the back branches it seems
best to just touch the places that actually have a problem.
2004-10-13 22:22:22 +00:00
Teodor Sigaev
144dc30554 Remove asymetrical word processing in query and text 2004-06-07 16:49:25 +00:00
Joe Conway
a7e5e2fe74 When returning type "record", replace use of pgresultGetTupleDesc
with ReturnSetInfo->expectedDesc. This allows custom datatypes
(e.g. from tsearch2) to be returned at runtime. Previous behavior
depended on the type oid to match between the remote and local
database, which obviously doesn't work well for custom types.
Per report from Mark Gibson.
2004-02-24 06:07:52 +00:00
Joe Conway
7ce7e3f036 pply quote_literal to the start_with argument of connectby. Fixes problem
reported by David Garamond when working with bytea parent and child keys.
2004-02-24 05:26:27 +00:00
Joe Conway
005887d1c0 Added missing SPI_finish() calls to get_tuple_of_interest(). Fixes bug
reported by Andrea Grassi.
2003-11-26 20:44:54 +00:00
Teodor Sigaev
fd9397c0e7 Allow sub[path|ltre] return void result 2003-07-22 14:08:58 +00:00
Teodor Sigaev
57970c37f8 Mark as deprecated 2003-07-22 14:04:50 +00:00
Tom Lane
8236cd7e74 Repair quoting sloppiness, lack of schema awareness in reindexdb. 2003-05-19 01:00:18 +00:00
Tom Lane
1e3fbccd6c Fix failure when uniq-ifying an array of zero elements.
Teodor Sigaev
2003-05-16 18:50:00 +00:00
Tom Lane
ab90b49f6b Check calling context for connectby_text(), per Joe Conway. 2003-05-16 06:07:58 +00:00
Bruce Momjian
7c100e96b7 Please, apply patch for contrib/ltree to current CVS and 7.3.2
CHANGES

Mar 28, 2003
Added finctions index(ltree,ltree,offset), text2ltree(text),
ltree2text(text)

Teodor Sigaev
2003-03-31 20:59:20 +00:00
Bruce Momjian
e8b9aeea41 The attatched patch fixes a memory error with contrib/dbmirror/pending.c
when running it with older(Pre 7.3.x) versions of Postgresql.

Backpatched to 7.3.X.

Steven Singer
2003-03-20 03:58:48 +00:00
Bruce Momjian
00cb9384a1 Please apply patches for contrib/ltree.
ltree_73.patch.gz - for 7.3 :
        Fix ~ operation bug: eg '1.1.1' ~ '*.1'

ltree_74.patch.gz - for current CVS
    Fix ~ operation bug: eg '1.1.1' ~ '*.1'
    Add ? operation
    Optimize index storage

Last change needs drop/create all ltree indexes, so only for 7.4

Teodor Sigaev
2003-02-19 03:50:49 +00:00
Tom Lane
b52fe8dcc8 Tweak bison build rules so that we get the same error messages from
bison 1.875 and later as we did from earlier bison releases.  Eventually
we will probably want to adopt the newer message spelling ... but not yet.
Per recent discussion on pgpatches.
Note: I didn't change the build rules for bootstrap, ecpg, or plpgsql
grammars, since these do not affect regression test results.
2003-01-31 20:58:28 +00:00
Bruce Momjian
7112d38c7e This patch fixes an incorrect statement and makes a few cleanups to
contrib/fulltextindex/README.fti

Backpatched to 7.3.X too.

Neil Conway
2003-01-15 16:45:34 +00:00
Bruce Momjian
9ee86665ef Upgrade to my2pg 1.9 2003-01-07 22:18:49 +00:00
Bruce Momjian
b2353a3db6 Upgrade to even newer ora2pg 2.0. 2003-01-07 22:17:23 +00:00
Bruce Momjian
de1096bd8e Upgrade to ora2pg 1.10. Backpatch to 7.3.X. 2003-01-07 22:16:19 +00:00
Hiroshi Inoue
4bd41a4d50 Add casts between oid and lo in contrib. 2003-01-03 15:43:33 +00:00
Bruce Momjian
0b91b448f4 Small fix in documentation and some examples of usage. Please, apply to
7.3 and current CVS

Oleg Bartunov
2002-12-27 14:10:49 +00:00
Bruce Momjian
8fba8caba6 This patch fixes minor bugs in dictionary generator in contrib/tsearch
(contrib/tsearch/makedict/makedict.pl)

[ Backpatched to 7.3.]

Teodor Sigaev
2002-12-13 05:50:41 +00:00
Bruce Momjian
ab6e38e40a Thank you very much, you catch it :). This bug had a long life, because it
exists if and only if locale of postmaster
was a different from C (or ru_RU.KOI8-R).

Please, apply patch for current CVS & 7.3.1

Magnus Naeslund(f) wrote:
> Ok, I nailed the bug, but i'm not sure what the correct fix is.
> Attached tsearch_morph.diff that remedies this problem by avoiding it.
> Also there's a debug aid patch if someone would like to know how i
> finally found it out :)
>
> There problem in the lemmatize() function is that GETDICT(...) returned
> a value not handled (BYLOCALE).
> The value (-1) and later used as an index into the dicts[] array.
> After that everything went berserk stack went crazy somehow so trapping
> the fault sent me to the wrong place, and every time i read the value it
> was positive ;)
>
> So now i just return the initial word passed to the lemmatize function,
> because i don't know what to do with it.

Magnus Naeslund
2002-12-06 05:15:32 +00:00