From ab9602d88f1d4842989dd4f0267cbe3e5fa45fe2 Mon Sep 17 00:00:00 2001 From: "cls%seawood.org" Date: Wed, 1 Dec 2004 00:22:53 +0000 Subject: [PATCH] Verify that the given cvsroot is actually in our repository list. Bug #261616 r=timeless --- webtools/bonsai/cvsquery.cgi | 2 ++ webtools/bonsai/cvsqueryform.cgi | 2 ++ webtools/bonsai/cvsview2.cgi | 1 + webtools/bonsai/moduleanalyse.cgi | 1 + webtools/bonsai/modules.pl | 1 + webtools/bonsai/multidiff.cgi | 1 + webtools/bonsai/rview.cgi | 8 +------- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/webtools/bonsai/cvsquery.cgi b/webtools/bonsai/cvsquery.cgi index a6892d2395d..9bbd3c3645c 100755 --- a/webtools/bonsai/cvsquery.cgi +++ b/webtools/bonsai/cvsquery.cgi @@ -48,6 +48,8 @@ require 'CGI.pl'; $::CVS_ROOT = $::FORM{'cvsroot'}; $::CVS_ROOT = pickDefaultRepository() unless $::CVS_ROOT; +&validateRepository($::CVS_ROOT); + $::TreeID = $::FORM{'module'} if (!exists($::FORM{'treeid'}) && exists($::FORM{'module'}) && diff --git a/webtools/bonsai/cvsqueryform.cgi b/webtools/bonsai/cvsqueryform.cgi index 8d68c8681ab..b2edd4cffd9 100755 --- a/webtools/bonsai/cvsqueryform.cgi +++ b/webtools/bonsai/cvsqueryform.cgi @@ -34,6 +34,8 @@ print "Content-type: text/html\n\n"; LoadTreeConfig(); $::CVS_ROOT = $::FORM{'cvsroot'}; $::CVS_ROOT = pickDefaultRepository() unless $::CVS_ROOT; +&validateRepository($::CVS_ROOT); + if (exists $::FORM{'module'}) { if (exists($::TreeInfo{$::FORM{'module'}}{'repository'})) { $::TreeID = $::FORM{'module'} diff --git a/webtools/bonsai/cvsview2.cgi b/webtools/bonsai/cvsview2.cgi index d86630bd1ea..4339bea27cc 100755 --- a/webtools/bonsai/cvsview2.cgi +++ b/webtools/bonsai/cvsview2.cgi @@ -177,6 +177,7 @@ $rcsdiff .= ' -w' if ($opt_whitespace_mode eq 'ignore'); my $root = $opt_root; if (defined $root && $root ne '') { $root =~ s|/$||; + &validateRepository($root); if (-d $root) { unshift(@SRCROOTS, $root); } else { diff --git a/webtools/bonsai/moduleanalyse.cgi b/webtools/bonsai/moduleanalyse.cgi index 7f48bd50551..dd65d9ec259 100755 --- a/webtools/bonsai/moduleanalyse.cgi +++ b/webtools/bonsai/moduleanalyse.cgi @@ -43,6 +43,7 @@ print "Content-type: text/html\n\n"; my $CVS_ROOT = $::FORM{'cvsroot'}; $CVS_ROOT = pickDefaultRepository() unless $CVS_ROOT; +&validateRepository($CVS_ROOT); PutsHeader("CVS Module Analyzer", $CVS_ROOT); diff --git a/webtools/bonsai/modules.pl b/webtools/bonsai/modules.pl index 344a8081ae7..e94c82e8022 100755 --- a/webtools/bonsai/modules.pl +++ b/webtools/bonsai/modules.pl @@ -31,6 +31,7 @@ $::modules = {}; if( $::CVS_ROOT eq "" ){ $::CVS_ROOT = pickDefaultRepository(); } +&validateRepository($::CVS_ROOT); my $CVS_MODULES; diff --git a/webtools/bonsai/multidiff.cgi b/webtools/bonsai/multidiff.cgi index 078cc83ea1f..0ea61436dd4 100755 --- a/webtools/bonsai/multidiff.cgi +++ b/webtools/bonsai/multidiff.cgi @@ -60,6 +60,7 @@ if( $form{"cvsroot"} ){ else { $cvsroot = pickDefaultRepository(); } +&validateRespository($cvsroot); if( $form{"allchanges"} ){ @revs = split(/,/, $form{"allchanges"} ); diff --git a/webtools/bonsai/rview.cgi b/webtools/bonsai/rview.cgi index 40158e7eebe..abf5d0b7726 100755 --- a/webtools/bonsai/rview.cgi +++ b/webtools/bonsai/rview.cgi @@ -42,6 +42,7 @@ $|=1; my $CVS_ROOT = $::FORM{"cvsroot"}; $CVS_ROOT = pickDefaultRepository() unless $CVS_ROOT; +&validateRepository($CVS_ROOT); LoadTreeConfig(); $::TreeID = $::FORM{'module'} @@ -75,13 +76,6 @@ my $script_str; &setup_script; $::Setup_String = $script_str; - -if( $CVS_ROOT eq "" ){ - $CVS_ROOT = pickDefaultRepository(); -} - -validateRepository($CVS_ROOT); - my $s = ""; if ($rev) {