1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-17 06:41:24 +03:00

810 Commits

Author SHA1 Message Date
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
Teodor Sigaev
989a17a68c Prevent rank change in case of duplicate search terms 2005-03-05 16:19:33 +00:00
Tom Lane
ae8db9a7ab Make sure contrib C functions are marked strict where needed.
Kris Jurka
2005-01-29 22:35:30 +00:00
Tom Lane
b9fccbb71c Now that I look at it, int_array_enum() didn't work either. 2005-01-27 21:50:15 +00:00
Tom Lane
3393e65c6d 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:35:56 +00:00
Neil Conway
db78e53fac 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:10:08 +00:00
Tom Lane
62a6019c49 Back-patch make_oidjoins_check security improvement. 2004-10-21 17:12:19 +00:00
Tom Lane
2d46f0e613 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:03 +00:00
Joe Conway
a1dd58e509 Hashed crosstab was dying with an SPI_finish error when the source SQL
produced no rows. Now it returns 0 rows instead. Adjusted regression
test for this case.
2004-08-11 01:02:08 +00:00
Teodor Sigaev
c0626280c7 Fix stupid bug in installcheck 2004-06-23 10:03:57 +00:00
Tom Lane
2e11ef8be8 Now needs to include <ctype.h>. 2004-06-12 20:31:48 +00:00
Teodor Sigaev
db688bc1c3 Remove asymetrical word processing in query and text 2004-06-07 16:48:49 +00:00
Bruce Momjian
84b64ab569 Fix problems in pg_autovacuum:
1) temp table crash

2) Check send_query() function call return value.

Backpatch to 7.4.X.
2004-05-26 18:48:37 +00:00
Teodor Sigaev
fb411a4768 Minimize memory allocation for void (but not null) value. 2004-03-25 16:50:49 +00:00
Bruce Momjian
f2cc5330cc In working through a pg_autovacuum problem with Joe Conway (which turned
out to be the same problem reported by Cott Lang which the previous
patch resolved) a new bug was uncovered when running with a debug level
of greater than 1.

This patch resolves this new found bug and fixes some of the other
debugging output to be more consistent.

Please apply to both HEAD and the 7.4 branch.


Matthew T. O'Connor
2004-03-22 03:57:19 +00:00
Bruce Momjian
774571fd08 Fix pg_autovacuum to handle unsigned and oids better.
Matthew T. O'Connor
2004-03-17 13:16:28 +00:00
Joe Conway
27ae96c2b6 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:34 +00:00
Joe Conway
78c97b156e Apply 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:07 +00:00
Tom Lane
6b534f3c33 Replace opendir/closedir calls throughout the backend with AllocateDir
and FreeDir routines modeled on the existing AllocateFile/FreeFile.
Like the latter, these routines will avoid failing on EMFILE/ENFILE
conditions whenever possible, and will prevent leakage of directory
descriptors if an elog() occurs while one is open.
Also, reduce PANIC to ERROR in MoveOfflineLogs() --- this is not
critical code and there is no reason to force a DB restart on failure.
All per recent trouble report from Olivier Hubaut.
2004-02-23 23:03:43 +00:00
Bruce Momjian
41d9c5e067 The following bug has been logged online:
Bug reference:      1081
Logged by:          Aarjav Trivedi

Email address:      aarjav@cc.gatech.edu

PostgreSQL version: 7.4

Operating system:   Linux

Description:        Spelling error in tsearch2.sql leading to problems
with
tsearch

Details:

On line 620 of tsearch2.sql which is required to install and run
TSEARCH,

REATE FUNCTION tsstat_in(cstring)

should be

CREATE FUNCTION tsstat_in(cstring)

because of this error, TSEARCH fails to work as specified,
2004-02-21 03:48:55 +00:00
Teodor Sigaev
ac760b6bff Docs fix from Kris Jurka <books@ejurka.com> 2004-01-26 15:08:58 +00:00
Teodor Sigaev
767adcf5d6 Correct type for isalnum 2004-01-19 18:40:23 +00:00
Tom Lane
2fb41f900a Remove broken (and unnecessary) definition of operator <> for _int4
datatype; the generic array comparators added in 7.4 supersede this.
Per report and patch from Korea PostgreSQL Users' Group.
2004-01-08 23:40:36 +00:00
Tom Lane
f79c36fc6f Repair badly broken estimation of output buffer size in lquery_out(). 2003-12-17 20:15:53 +00:00
Tom Lane
9edff888bd Minor autovacuum fixes from Matthew O'Connor. 2003-12-08 21:54:05 +00:00
Tom Lane
2cfbbb1078 Add fflush() before sleeping, per Matthew O'Connor. 2003-12-08 21:51:37 +00:00
Tom Lane
1db8cd36d8 Replace unportable and overflow-prone use of 'long long' with safer
'double' arithmetic, per recent discussion.
2003-12-07 19:56:07 +00:00
Teodor Sigaev
1a1485115e One more fix confusion 2003-12-05 15:38:30 +00:00
Teodor Sigaev
84d2ed136c Avoid confusion start_parse_str function with tsearch V1 2003-12-05 14:28:21 +00:00
Teodor Sigaev
be5a80739b Fix for word with several infinitives 2003-12-03 16:06:59 +00:00
Bruce Momjian
e16c318590 I've run across a pretty serious problem with pg_autovacuum.
pg_autovacuum looses track of any table that's ever been truncated
(possibly other situations too).   When i truncate a table it gets a
new relfilenode in pg_class.  This is a problem because pg_autovacuum
assumes pg_class.relfilenode will join to pg_stats_all_tables.relid.
pg_stats_all_tables.relid is actallly the oid from pg_class, not the
relfilenode.   These two values start out equal so pg_autovacuum works
initially, but it fails later on because of this incorrect assumption.

This patch fixes that problem.  Applied to HEAD and 7.4.X.

Brian Hirt
2003-12-01 23:19:54 +00:00
Bruce Momjian
0bdc0a6d33 I noticed in the 7.4 release that in contrib/pg_autovacuum, args->logfile is
not initialized if a log file is not specified on the command line.  This
causes an immediate segfault on systems that fill allocated memory with some
value other than zero (my FreeBSD machine uses 0xD0).

Several crashes later I discovered that args->user, password, host, and port
are also used without being initialized.

This doesn't appear to be fixed in CVS and I came up empty on a mailing list
search -- hope it hasn't been reported already.

Craig Boston
2003-12-01 23:14:29 +00:00
Joe Conway
e664c28fe7 Fix regression in dblink_disconnect() reported by Eduardo Stern:
persistent_conn was left dangling after a disconnect in the
unnamed connection case, causing a subsequent disconnect to
crash the backend.
2003-11-28 05:03:48 +00:00
Teodor Sigaev
f77c90b3de Fixes about word with several infiniteve 2003-11-27 16:08:41 +00:00
Joe Conway
da876b5df4 Added missing SPI_finish() calls to get_tuple_of_interest(). Fixes bug
reported by Andrea Grassi.
2003-11-26 20:44:13 +00:00