Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZItgK-0006kK-Le for pgsql-hackers@arkaria.postgresql.org; Sat, 25 Jul 2015 07:15:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZItgK-0007F1-7A for pgsql-hackers@arkaria.postgresql.org; Sat, 25 Jul 2015 07:15:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZItf4-0005lD-Pk for pgsql-hackers@postgresql.org; Sat, 25 Jul 2015 07:14:22 +0000 Received: from mail-pa0-x22a.google.com ([2607:f8b0:400e:c03::22a]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZItex-0007RA-3S for pgsql-hackers@postgresql.org; Sat, 25 Jul 2015 07:14:21 +0000 Received: by pabkd10 with SMTP id kd10so24982552pab.2 for ; Sat, 25 Jul 2015 00:14:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=vUOGXWidcYG1nO7wRchxViekDuA1ArMV398uGxnMAXs=; b=Jgi21FllJtgIUvsdf63nJvDVZqQRdkIxea1lwuPwZ9J1eUHrrSFD/xbxz7Zu9tZmnm 0pcf/RQ4C66+ZROpqqGvP6G07dibLUlxqc1rPMyjNsQa4ohhK8xnYWmc+cszAdPT7Xmr H6Vntsmsk2wg+HoeH7RiaQdfYYK8gnnKSVbkg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=vUOGXWidcYG1nO7wRchxViekDuA1ArMV398uGxnMAXs=; b=cVPiT2eiptrq6kiiCg9SvPNBWsNxOrhFFCOXaxdmtnp7bCUZgN29jNclFI7OiqURc8 8GmcWz2ZCrbDUkiccRd86GvzgYfwJuXmEpruwzFHnbCkiDV+bpwdJPJ2+qHkA7TKJ5fn z72zk3XgIKrmSS38lasgitqs2s/frZ9SxxTH//3ivPdYgHnO61fGAHNsWsyamv3Jhw0M fjNhu5GQtQBQN1b1Exu3s7r1WB+o+jNcnerOEij9WriC0xcvgGaXGw/q1CAMNjWuAODL pDQefJRmZg5z8YzT4d6jeiwm6F3p0IYP9fcxEhs/gJakMFW3Jw9/GtRYmGMFI7gAXCxN meWA== X-Gm-Message-State: ALoCoQkcE6dUSLACNNEQJWPcgRk//Cv5VAx0lkBITN1uZ3JJS0DfJL4a7wkHoOMcn+CCj8IPnhEQ X-Received: by 10.66.158.65 with SMTP id ws1mr40716653pab.18.1437808452047; Sat, 25 Jul 2015 00:14:12 -0700 (PDT) Received: from tornado.leadboat.com (c-98-248-47-228.hsd1.ca.comcast.net. [98.248.47.228]) by smtp.gmail.com with ESMTPSA id j5sm18154010pdi.7.2015.07.25.00.14.10 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 25 Jul 2015 00:14:11 -0700 (PDT) Date: Sat, 25 Jul 2015 03:14:08 -0400 From: Noah Misch To: Heikki Linnakangas Cc: Michael Paquier , PostgreSQL mailing lists Subject: Re: Supporting TAP tests with MSVC and Windows Message-ID: <20150725071408.GA1442444@tornado.leadboat.com> References: <20150403062230.GA1153652@tornado.leadboat.com> <55B2758E.1010205@iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55B2758E.1010205@iki.fi> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On Fri, Jul 24, 2015 at 08:27:42PM +0300, Heikki Linnakangas wrote: > On 06/25/2015 07:40 AM, Michael Paquier wrote: > >Attached is v7, rebased on 0b157a0. > > Thanks! I fiddled with this a bit more, to centralize more of the > platform-dependent stuff to RewindTest.pm. Also, Windows doesn't have "cat" > and "touch" if you haven't installed MinGW, so I replaced those calls with > built-in perl code. My main priority for this patch is to not reintroduce CVE-2014-0067. The patch is operating in a security minefield: > --- a/src/bin/pg_ctl/t/001_start_stop.pl > +++ b/src/bin/pg_ctl/t/001_start_stop.pl > @@ -15,13 +15,9 @@ command_exit_is([ 'pg_ctl', 'start', '-D', "$tempdir/nonexistent" ], > > command_ok([ 'pg_ctl', 'initdb', '-D', "$tempdir/data" ], 'pg_ctl initdb'); > command_ok( > - [ "$ENV{top_builddir}/src/test/regress/pg_regress", '--config-auth', > + [ $ENV{PG_REGRESS}, '--config-auth', > "$tempdir/data" ], > 'configure authentication'); > -open CONF, ">>$tempdir/data/postgresql.conf"; > -print CONF "listen_addresses = ''\n"; > -print CONF "unix_socket_directories = '$tempdir_short'\n"; > -close CONF; > command_ok([ 'pg_ctl', 'start', '-D', "$tempdir/data", '-w' ], > 'pg_ctl start -w'); Since this series of tests doesn't use standard_initdb, the deleted lines remain necessary. > @@ -303,7 +297,6 @@ sub run_pg_rewind > } > else > { > - > # Cannot come here normally Unrelated change. > sub standard_initdb > { > my $pgdata = shift; > system_or_bail('initdb', '-D', "$pgdata", '-A' , 'trust', '-N'); > - system_or_bail("$ENV{top_builddir}/src/test/regress/pg_regress", > - '--config-auth', $pgdata); > + system_or_bail($ENV{PG_REGRESS}, '--config-auth', $pgdata); > + > + my $tempdir_short = tempdir_short; > + > + open CONF, ">>$pgdata/postgresql.conf"; > + print CONF "\n# Added by TestLib.pm)\n"; > + if ($Config{osname} eq "MSWin32") > + { > + print CONF "listen_addresses = '127.0.0.1'\n"; > + } > + else > + { > + print CONF "unix_socket_directories = '$tempdir_short'\n"; This second branch needs listen_addresses=''; it doesn't help to secure the socket directory if the server still listens on localhost. > +sub configure_hba_for_replication > +{ > + my $pgdata = shift; > + > + open HBA, ">>$pgdata/pg_hba.conf"; > + print HBA "\n# Allow replication (set up by TestLib.pm)\n"; > + if ($Config{osname} ne "MSWin32") > + { > + print HBA "local replication all trust\n"; > + } > + else > + { > + print HBA "host replication all 127.0.0.1/32 sspi include_realm=1 map=regress\n"; > + print HBA "host replication all ::1/128 sspi include_realm=1 map=regress\n"; The second line will make the server fail to start on non-IPv6 systems. You shouldn't need it if the clients always connect to 127.0.0.1, not "localhost". > + configure_for_replication("$tempdir/pgdata"); That function name appears nowhere else. > +sub tapcheck > +{ > + InstallTemp(); > + > + my @args = ( "prove", "--verbose", "t/*.pl"); > + > + $ENV{PATH} = "$tmp_installdir/bin;$ENV{PATH}"; > + $ENV{PERL5LIB} = "$topdir/src/test/perl;$ENV{PERL5LIB}"; > + $ENV{PG_REGRESS} = "$topdir/$Config/pg_regress/pg_regress"; > + > + # Find out all the existing TAP tests by simply looking for t/ > + # in the tree. This target shall not run the SSL suite, for the same reason check-world shall not run it. We could offer a distinct vcregress.pl target for TAP suites excluded from check-world. nm -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers