From 87b04494a671ada1f03a3f134d38235159b648c9 Mon Sep 17 00:00:00 2001 From: Andrew Dunstan Date: Sun, 24 Jul 2011 14:22:31 -0700 Subject: [PATCH] Check that branch is listed in branches_of_interest.txt --- cgi-bin/pgstatus.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cgi-bin/pgstatus.pl b/cgi-bin/pgstatus.pl index 9043b32..742732a 100755 --- a/cgi-bin/pgstatus.pl +++ b/cgi-bin/pgstatus.pl @@ -57,6 +57,22 @@ my $changed_this_run = $query->param('changed_files'); my $log_archive = $query->param('logtar'); my $frozen_sconf = $query->param('frozen_sconf') || ''; +my $brhandle; +if (open($brhandle,"../htdocs/branches_of_interest.txt")) +{ + my @branches_of_interest = <$brhandle>; + close($brhandle); + chomp(@branches_of_interest); + unless (grep {$_ eq $branch} @branches_of_interest) + { + print + "Status: 492 bad branch parameter $branch\nContent-Type: text/plain\n\n", + "bad branch parameter $branch\n"; + exit; + } +} + + my $content = "branch=$branch&res=$res&stage=$stage&animal=$animal&". "ts=$ts&log=$log&conf=$conf"; -- 2.30.2