summaryrefslogtreecommitdiff
path: root/src/tools/msvc
diff options
context:
space:
mode:
authorNoah Misch <noah@leadboat.com>2014-12-17 22:48:40 -0500
committerNoah Misch <noah@leadboat.com>2014-12-17 22:48:40 -0500
commitf6dc6dd5ba54d52c0733aaafc50da2fbaeabb8b0 (patch)
tree4cba95a8ca5f305feac60ead92f8fdd3519311aa /src/tools/msvc
parentfc2ac1fb41c2defb8caf825781af75db158fb7a9 (diff)
downloadpostgresql-f6dc6dd5ba54d52c0733aaafc50da2fbaeabb8b0.tar.gz
Lock down regression testing temporary clusters on Windows.
Use SSPI authentication to allow connections exclusively from the OS user that launched the test suite. This closes on Windows the vulnerability that commit be76a6d39e2832d4b88c0e1cc381aa44a7f86881 closed on other platforms. Users of "make installcheck" or custom test harnesses can run "pg_regress --config-auth=DATADIR" to activate the same authentication configuration that "make check" would use. Back-patch to 9.0 (all supported versions). Security: CVE-2014-0067
Diffstat (limited to 'src/tools/msvc')
-rw-r--r--src/tools/msvc/vcregress.pl14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl
index 699c2869d9..f9b4f3c352 100644
--- a/src/tools/msvc/vcregress.pl
+++ b/src/tools/msvc/vcregress.pl
@@ -247,6 +247,15 @@ sub contribcheck
exit $mstat if $mstat;
}
+# Run "initdb", then reconfigure authentication.
+sub standard_initdb
+{
+ return (
+ system('initdb', '-N') == 0 and system(
+ "$topdir/$Config/pg_regress/pg_regress", '--config-auth',
+ $ENV{PGDATA}) == 0);
+}
+
sub upgradecheck
{
my $status;
@@ -258,6 +267,7 @@ sub upgradecheck
# i.e. only this version to this version check. That's
# what pg_upgrade's "make check" does.
+ $ENV{PGHOST} = 'localhost';
$ENV{PGPORT} ||= 50432;
my $tmp_root = "$topdir/contrib/pg_upgrade/tmp_check";
(mkdir $tmp_root || die $!) unless -d $tmp_root;
@@ -275,7 +285,7 @@ sub upgradecheck
my $logdir = "$topdir/contrib/pg_upgrade/log";
(mkdir $logdir || die $!) unless -d $logdir;
print "\nRunning initdb on old cluster\n\n";
- system("initdb") == 0 or exit 1;
+ standard_initdb() or exit 1;
print "\nStarting old cluster\n\n";
system("pg_ctl start -l $logdir/postmaster1.log -w") == 0 or exit 1;
print "\nSetting up data for upgrading\n\n";
@@ -289,7 +299,7 @@ sub upgradecheck
system("pg_ctl -m fast stop") == 0 or exit 1;
$ENV{PGDATA} = "$data";
print "\nSetting up new cluster\n\n";
- system("initdb") == 0 or exit 1;
+ standard_initdb() or exit 1;
print "\nRunning pg_upgrade\n\n";
system("pg_upgrade -d $data.old -D $data -b $bindir -B $bindir") == 0
or exit 1;