1139 Commits

Author SHA1 Message Date
Teodor Sigaev
feb4596697 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:41:16 +00:00
Tom Lane
773f5cc8cb Fix contrib/xml2 makefile to not override CFLAGS. 2008-05-08 17:11:41 +00:00
Tom Lane
52441adb15 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:16 +00:00
Tom Lane
207f469912 Fix core dump in contrib/xml2's xpath_table() when the input query returns
a NULL value.  Per bug #4058.
2008-03-26 01:19:23 +00:00
Tom Lane
148bd52da4 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:30 +00:00
Teodor Sigaev
9275f2d34c 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:09:15 +00:00
Joe Conway
0b33e2066f 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:01:50 +00:00
Tom Lane
d218e2332b Defend against openssl libraries that fail on keys longer than 128 bits;
which is the case at least on some Solaris versions.  Marko Kreen
2007-09-29 15:50:07 +00:00
Teodor Sigaev
bc16ca2746 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:30:53 +00:00
Teodor Sigaev
8605cfaa3d Fix header's size of structs defines in ispell. 2007-09-11 13:06:28 +00:00
Tom Lane
d68b66984c 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:05 +00:00
Joe Conway
7ff65db8b0 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:32:44 +00:00
Teodor Sigaev
368cc140d9 Fix caching of unsuccessful initialization of parser or configuration.
Per report from Listmail <lists@peufeu.com>
2007-04-02 11:42:44 +00:00
Teodor Sigaev
3e5a4a9a08 Fix backend crash in parsing incorrect tsquery.
Per report from Jon Rosebaugh <jon@inklesspen.com>
2007-02-12 14:17:40 +00:00
Tatsuo Ishii
e6be37ffe2 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-10 01:44:30 +00:00
Teodor Sigaev
3dd05aba09 Fix convertion for 'PFX flag N num' 2006-12-21 17:35:55 +00:00
Teodor Sigaev
60a25e6f6f Add description of tsvector type layout 2006-08-29 13:57:11 +00:00
Teodor Sigaev
3538b740f3 Remove pos comparison in silly_cmp_tsvector(): it is not a semantically significant 2006-08-29 13:40:11 +00:00
Teodor Sigaev
a3cb2221f3 Fix incorrect length of lexemes in silly_cmp_tsvector() 2006-08-29 13:32:21 +00:00
Teodor Sigaev
747b82aa6a Fix regression tests: after changing comparing function
order is changed.
2006-08-25 07:39:22 +00:00
Teodor Sigaev
2ec2b2caf0 Fix compare bug for tsvector: problem was in aligment. Per Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> and Phil Frost <indigo@bitglue.com> 2006-08-24 17:38:00 +00:00
Teodor Sigaev
73761f3659 Fix bug introduced by last patch, thanks again to Mario Weilguni <mweilguni@sime.com> 2006-08-08 15:45:24 +00:00
Teodor Sigaev
e33ab5b6d5 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:40:20 +00:00
Neil Conway
381ebcd21f Fix references to the Options section in the pgcrypto documentation.
Patch from Michael Fuhr.
2006-08-05 00:29:14 +00:00
Teodor Sigaev
f446ede326 Fix bug corrupting query in gist consistent function.
Thank to Mario Weilguni <mweilguni@sime.com> to discover a bug.
2006-07-11 16:02:50 +00:00
Bruce Momjian
fe204535a7 Backpatch dbmirror fix for escape handling.
> 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?

Olivier, can you please confirm that the patch works for you, too?

Backpatched to 8.0.X.

Martin Pitt
2006-07-06 01:57:34 +00:00
Joe Conway
e582d2ee1a - During dblink_open, if transaction state was IDLE, force cursor count to
initially be 0. This is needed as a previous ABORT might have wiped out
  an automatically opened transaction without maintaining the cursor count.
- Fix regression test expected file for the correct ERROR message, which
  we now get given the above bug fix.
2006-06-21 16:43:46 +00:00
Andrew Dunstan
b243d39456 backport workaround for OpenBSD compiler bug 2006-06-17 14:49:02 +00:00
Bruce Momjian
f671bee9d0 Re-defines SHA2 symbols so that they would not conflict with certain
versions of OpenSSL.  If your OpenSSL does not contain SHA2, then there
should be no conflict.  But ofcourse, if someone upgrades OpenSSL,
server starts crashing.

Backpatched to 8.1.X.

Marko Kreen
2006-05-30 12:56:56 +00:00
Tom Lane
dd2a4ce6ac Fix errors in fortuna PRNG reseeding logic that could cause a predictable
session key to be selected by pgp_sym_encrypt() in some cases.  This only
affects non-OpenSSL-using builds.  Marko Kreen
2006-05-21 20:22:23 +00:00
Bruce Momjian
3a3622c5f0 Back out \' change for tsearch2, broke regression tests. 2006-05-19 04:41:06 +00:00
Bruce Momjian
9a27f72b37 Use SQL standard '' rather than \' in /contrib. Backpatch to 8.1.X. 2006-05-19 02:39:04 +00:00
Teodor Sigaev
06e4478877 Detoast query in g_intbig_consistent and copy query in g_int_consistent.
Minor cleanups.
2006-04-03 09:35:35 +00:00
Tom Lane
effecebad1 Fix order of linking of libxslt and libxml2, per Dave Page. 2006-03-10 15:39:53 +00:00
Tom Lane
05d2a7256e Fix vacuumlo to avoid unnecessary use of backslash in search pattern.
Per Michael Fuhr.
2006-02-23 22:34:07 +00:00
Neil Conway
3bd549ba0a 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:48:53 +00:00
Tom Lane
4977c2b31b Replace bitwise looping with bytewise looping in hemdistsign and
sizebitvec of tsearch2, as well as identical code in several other
contrib modules.  This provided about a 20X speedup in building a
large tsearch2 index ... didn't try to measure its effects for other
operations.  Thanks to Stephan Vollmer for providing a test case.
2006-01-20 22:46:40 +00:00
Tom Lane
f5b50af291 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:38 +00:00
Joe Conway
17903a7375 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:46:32 +00:00
Teodor Sigaev
dacf7e774d Fix word's length in pg_regexec call 2005-12-21 13:07:38 +00:00
Tom Lane
31a21e3df0 Remove incorrect increment of lineno, per David Fetter.
Sync HEAD and 8.1 branches of pgbench.
2005-12-10 01:09:14 +00:00
Bruce Momjian
7f155c3322 I recently received the Debian bug report below about missing iconv
support for the dbf2pg contrib module.

The submitter created a patch which replaces the silent ignoring of -F
(when iconv support is disabled) with a meaningful warning.

Martin Pitt
2005-12-08 18:04:38 +00:00
Teodor Sigaev
3482b4597e Fix stupid bug with sizeof 2005-12-06 18:22:27 +00:00
Tatsuo Ishii
3824460544 Two fixes from Tom Lan. See the posting "[PATCHES] A couple of
proposed pgbench changes" on 2005/11/29 for more details.

The change at line 490 updates doCustom's local variable "commands"
after selecting a new file (command sequence).  I think that the
existing coding will cause the thing to use the first command of the
old sequence in the remainder of the routine, which would be a bug.
I have not tried to set up a test case to prove it, though.

The other two changes cause doCustom to loop after processing a
meta-command.  This might be a bit controversial, but as the code
is currently written, each meta-command "costs" one cycle of the
outer select() loop.  Thus, for example, with the default TPC-B script,
once a backend returns "COMMIT" it will not receive a new command
until four cycles of issuing commands to other backends have elapsed.
(You can see this very easily by strace'ing pgbench under load.)
2005-12-04 01:22:42 +00:00
Tatsuo Ishii
45722010ef Having blank lines in -f scripts was causing silent failures.
per David Fetter
2005-11-23 13:23:34 +00:00
Bruce Momjian
bef7764835 Re-run pgindent, fixing a problem where comment lines after a blank
comment line where output as too long, and update typedefs for /lib
directory.  Also fix case where identifiers were used as variable names
in the backend, but as typedefs in ecpg (favor the backend for
indenting).

Backpatch to 8.1.X.
2005-11-22 18:23:31 +00:00
Teodor Sigaev
6812abb673 Fix incorrect header size macros 2005-11-03 18:16:31 +00:00
Tom Lane
da9fc25909 pgcrypto documentation polishing from Marko Kreen, and a small amount
of copy-editing from myself.
2005-11-03 02:54:07 +00:00
Teodor Sigaev
1dd6bd19fa Add sanity check of query 2005-10-31 13:47:09 +00:00
Tom Lane
9ee0a7df50 Fix some allocation size calculation errors that would cause pgbench
to fail with large test scripts.
2005-10-29 19:38:07 +00:00