Commit Graph

1974 Commits

Author SHA1 Message Date
Tom Lane ca59dfa6f7 Apply upstream fix for blowfish signed-character bug (CVE-2011-2483).
A password containing a character with the high bit set was misprocessed
on machines where char is signed (which is most).  This could cause the
preceding one to three characters to fail to affect the hashed result,
thus weakening the password.  The result was also unportable, and failed
to match some other blowfish implementations such as OpenBSD's.

Since the fix changes the output for such passwords, upstream chose
to provide a compatibility hack: password salts beginning with $2x$
(instead of the usual $2a$ for blowfish) are intentionally processed
"wrong" to give the same hash as before.  Stored password hashes can
thus be modified if necessary to still match, though it'd be better
to change any affected passwords.

In passing, sync a couple other upstream changes that marginally improve
performance and/or tighten error checking.

Back-patch to all supported branches.  Since this issue is already
public, no reason not to commit the fix ASAP.
2011-06-21 14:41:05 -04:00
Bruce Momjian e3df3572f6 In pg_upgrade, clean up code layout in validateDirectoryOption(). 2011-06-15 17:23:02 -04:00
Bruce Momjian 07d17a73ec In pg_upgrade, check there are no prepared transactions. 2011-06-14 14:53:35 -04:00
Bruce Momjian 6560407c7d Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
Tom Lane 3ebc061c18 Make citext's equality and hashing functions collation-insensitive.
This is an ugly hack to get around the fact that significant parts of the
core backend assume they don't need to worry about passing collation to
equality and hashing functions.  That's true for the core string datatypes,
but citext should ideally have equality behavior that depends on the
specified collation's LC_CTYPE.  However, there's no chance of fixing the
core before 9.2, so we'll have to live with this compromise arrangement for
now.  Per bug #6053 from Regina Obe.

The code changes in this commit should be reverted in full once the core
code is up to speed, but be careful about reverting the docs changes:
I fixed a number of obsolete statements while at it.
2011-06-08 15:25:02 -04:00
Peter Eisentraut ba4cacf075 Recode non-ASCII characters in source to UTF-8
For consistency, have all non-ASCII characters from contributors'
names in the source be in UTF-8.  But remove some other more
gratuitous uses of non-ASCII characters.
2011-05-31 23:11:46 +03:00
Peter Eisentraut 4d7d6386d7 Remove literal tabs from message strings 2011-05-28 01:01:42 +03:00
Bruce Momjian 11c08c3fd7 In pg_upgrade, do case-insensitive checks of locale, encoding, and ctype
because these are often inconsistently capitalized.
2011-05-24 15:59:34 -04:00
Heikki Linnakangas ea896da394 Replace strdup() with pstrdup(), to avoid leaking memory.
It's been like this since the seg module was introduced, so backpatch to
8.2 which is the oldest supported version.
2011-05-18 22:49:22 -04:00
Bruce Momjian 1f35944607 In pg_upgrade, clean up handling of invalid directory specification by
checking the stat() errno value more strictly.
2011-05-18 22:22:40 -04:00
Bruce Momjian 772a5f1e5b Improve pg_upgrade error reporting if the bin or data directories do not
exist or are not directories.
2011-05-18 18:37:25 -04:00
Peter Eisentraut 0ee391b77a /contrib/foo -> contrib/foo
Since contrib is a relative directory specification, a leading slash
is inappropriate.
2011-05-19 00:30:31 +03:00
Bruce Momjian 92ff915018 Improve pg_upgrade X_OK comment. 2011-05-18 12:25:34 -04:00
Bruce Momjian 6fbf4e0e7c Fix pg_upgrade build problem on Windows when using X_OK access
permission check on the current directory.
2011-05-18 12:13:37 -04:00
Bruce Momjian e728701fb4 Update pg_upgrade directory check error message. 2011-05-16 12:32:36 -04:00
Bruce Momjian bda27e502f Add pg_upgrade check to make sure the user has full access permission in
the current directory;  if not, throw an error.
2011-05-16 11:01:29 -04:00
Bruce Momjian 6c19bd96bc Allow pg_upgrade to honor libpq environment variables. Add 'local'
checks for PGHOST and PGHOSTADDR.
2011-05-16 10:48:40 -04:00
Alvaro Herrera c6eb5740b3 Fix assorted typos 2011-05-12 08:52:56 -04:00
Peter Eisentraut 94a8fde403 Put options help in alphabetical order 2011-05-10 21:48:07 +03:00
Peter Eisentraut 00fad9f6fe Format pg_upgrade --version in line with conventions 2011-05-10 21:40:29 +03:00
Peter Eisentraut 4c78846cb3 Add bug report line to pg_upgrade --help output 2011-05-10 21:37:55 +03:00
Peter Eisentraut 3a8dcd9a1f Put pg_test_fsync --help and --version output in line with conventions
Foremost, it should go to stdout.
2011-05-10 21:34:26 +03:00
Bruce Momjian 5059cf6ebf In pg_upgrade, remove suggestion of setting pg_hba.conf to 'trust', now
that we report the libpq connection failure string.  Per suggestion from
Robert Haas.
2011-05-10 10:42:43 -04:00
Bruce Momjian 78318d63d7 In pg_upgrade, add status message about superuser check. 2011-05-09 08:55:36 -04:00
Bruce Momjian e6a7402842 Add C comment why client encoding can be set in pg_upgrade. 2011-05-07 22:30:35 -04:00
Bruce Momjian 1609ca5adb In pg_upgrade, report non-super-user username in error message. 2011-05-07 12:17:21 -04:00
Bruce Momjian 81301b8578 Check that the pg_upgrade user specified is a super-user.
Also report the error message when the post-pg_ctl connection fails.

Per private bug report from EnterpriseDB.
2011-05-07 08:55:45 -04:00
Bruce Momjian 5c5f83507c Adjust pg_upgrade FATAL error messages to have consistent newlines.
Also adjust some error message capitalization for consistency.
2011-05-06 21:47:42 -04:00
Peter Eisentraut b24181b26f Improve pg_archivecleanup and pg_standby --help output
For consistency with other tools, put the options before further usage
information.

In pg_standby, remove the supposedly deprecated -l option from the
given example invocation.
2011-05-05 23:19:13 +03:00
Peter Eisentraut d6d823c8b0 Improve formatting of pg_upgrade --help output 2011-05-05 23:19:13 +03:00
Bruce Momjian 6c4d2bd914 Now that pg_upgrade uses -w in pg_ctl, remove loop that retried testing
the connection;  also restructure the libpq connection code.

This patch also removes the unused variable postmasterPID and fixes a
libpq structure leak that was in the testing loop.
2011-04-26 10:15:18 -04:00
Bruce Momjian 44091442db In pg_upgrade, avoid one start/stop of the postmaster; use the -w
(wait) flag for pg_ctl start/stop;  remove the unused "quiet" flag in
the functions for starting/stopping the postmaster.
2011-04-25 20:18:23 -04:00
Peter Eisentraut f8ebe3bcc5 Support "make check" in contrib
Added a new option --extra-install to pg_regress to arrange installing
the respective contrib directory into the temporary installation.
This is currently not yet supported for Windows MSVC builds.

Updated the .gitignore files for contrib modules to ignore the
leftovers of a temp-install check run.

Changed the exit status of "make check" in a pgxs build (which still
does nothing) to 0 from 1.

Added "make check" in contrib to top-level "make check-world".
2011-04-25 22:27:11 +03:00
Bruce Momjian 76dd09bbec Add postmaster/postgres undocumented -b option for binary upgrades.
This option turns off autovacuum, prevents non-super-user connections,
and enables oid setting hooks in the backend.  The code continues to use
the old autoavacuum disable settings for servers with earlier catalog
versions.

This includes a catalog version bump to identify servers that support
the -b option.
2011-04-25 12:00:21 -04:00
Bruce Momjian f6322b3191 In pg_upgrade, only compile copy_file() on non-Win32 systems.
Per report from Andrew Dunstan.
2011-04-23 20:28:29 -04:00
Tom Lane bb85030630 Fix contrib/btree_gist to handle collations properly.
Make use of the collation attached to the index column, instead of
hard-wiring DEFAULT_COLLATION_OID.  (Note: in theory this could require
reindexing btree_gist indexes on textual columns, but I rather doubt anyone
has one with a non-default declared collation as yet.)
2011-04-22 20:19:58 -04:00
Tom Lane 474ff212e5 De-kludge contrib/btree_gin for collations.
Using DEFAULT_COLLATION_OID in the comparePartial functions was not only
a lame hack, but outright wrong, because the compare functions for
collation-aware types were already responding to the declared index
collation.  So comparePartial would have the wrong expectation about
the index's sort order, possibly leading to missing matches for prefix
searches.
2011-04-22 18:22:38 -04:00
Bruce Momjian 0262251c33 Pg_upgrade C comment addition.
Document why we do the missing new database check during the check
phase.
2011-04-20 05:45:31 -04:00
Bruce Momjian 7228d02989 Throw error for mismatched pg_upgrade clusters
If someone removes the 'postgres' database from the old cluster and the
new cluster has a 'postgres' database, the number of databases will not
match.  We actually could upgrade such a setup, but it would violate the
1-to-1 mapping of database counts, so we throw an error instead.

Previously they got an error during the upgrade, and not at the check
stage; PG 9.0.4 does the same.
2011-04-19 21:00:29 -04:00
Bruce Momjian 0341944706 Add C comment
Add C comment about why we throw an error if the pg_upgrade old/new
database counts don't match.
2011-04-19 19:15:13 -04:00
Peter Eisentraut 385942f46c Refix the unaccent regression test on MSVC properly
... for some value of "properly".  Instead of overriding REGRESS_OPTS,
set the variables ENCODING and NO_LOCALE, which is more expressive and
allows overriding by the user.  Fix vcregress.pl to handle that.
2011-04-19 22:52:52 +03:00
Peter Eisentraut 001cbb145f Avoid unused variable warnings for certain configurations 2011-04-19 20:01:51 +03:00
Andrew Dunstan b7b86924c6 Attempt to remedy buildfarm breakage caused by commit f536d4194. 2011-04-18 09:27:30 -04:00
Peter Eisentraut f536d41942 Rename pg_regress option --multibyte to --encoding
Also refactor things a little bit so that the same methods for setting
test locale and encoding can be used everywhere.
2011-04-15 08:42:05 +03:00
Tom Lane d64713df7e Pass collations to functions in FunctionCallInfoData, not FmgrInfo.
Since collation is effectively an argument, not a property of the function,
FmgrInfo is really the wrong place for it; and this becomes critical in
cases where a cached FmgrInfo is used for varying purposes that might need
different collation settings.  Fix by passing it in FunctionCallInfoData
instead.  In particular this allows a clean fix for bug #5970 (record_cmp
not working).  This requires touching a bit more code than the original
method, but nobody ever thought that collations would not be an invasive
patch...
2011-04-12 19:19:24 -04:00
Peter Eisentraut 5caa3479c2 Clean up most -Wunused-but-set-variable warnings from gcc 4.6
This warning is new in gcc 4.6 and part of -Wall.  This patch cleans
up most of the noise, but there are some still warnings that are
trickier to remove.
2011-04-11 22:28:45 +03:00
Andrew Dunstan c1d82a936f Remove CRLF line endings in new cube results file. 2011-04-10 18:26:53 -04:00
Andrew Dunstan 210f95f1cd Adjust regression tests on cube and ECPG for MinGW 64 bit compiler.
Backport to 9.0, we're not supporting this compiler on earlier releases.
2011-04-10 16:57:42 -04:00
Bruce Momjian bf50caf105 pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
Peter Eisentraut 1eb2231fc4 Allow pg_upgrade with PGCLIENTENCODING set
This used to work, but since PGCLIENTENCODING is now a connection
option variable, pg_upgrade would prevent it.
2011-04-07 19:24:47 +03:00