1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +03:00

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 be76a6d39e
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
This commit is contained in:
Noah Misch
2014-12-17 22:48:40 -05:00
parent 3f63b38fb2
commit 6b87d423dc
11 changed files with 213 additions and 28 deletions

View File

@ -7,6 +7,7 @@ use Exporter 'import';
our @EXPORT = qw(
tempdir
tempdir_short
standard_initdb
start_test_server
restart_test_server
psql
@ -69,6 +70,14 @@ sub tempdir_short
return File::Temp::tempdir(CLEANUP => 1);
}
sub standard_initdb
{
my $pgdata = shift;
system_or_bail("initdb -D '$pgdata' -A trust -N >/dev/null");
system_or_bail("$ENV{top_srcdir}/src/test/regress/pg_regress",
'--config-auth', $pgdata);
}
my ($test_server_datadir, $test_server_logfile);
sub start_test_server
@ -78,7 +87,7 @@ sub start_test_server
my $tempdir_short = tempdir_short;
system "initdb -D '$tempdir'/pgdata -A trust -N >/dev/null";
standard_initdb "$tempdir/pgdata";
$ret = system 'pg_ctl', '-D', "$tempdir/pgdata", '-s', '-w', '-l',
"$tempdir/logfile", '-o',
"--fsync=off -k $tempdir_short --listen-addresses='' --log-statement=all",