From 9a461bee192d78c330b671b88033de430076a5d9 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" Date: Tue, 8 Apr 2008 11:08:58 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20416382:=20Adding=20an=20attachment=20with?= =?UTF-8?q?=20Perl=205.10=20and=20CGI.pm=20<=203.33=20throws=20a=20taint?= =?UTF-8?q?=20error=20-=20Patch=20by=20Fr=C3=83=C2=A9d=C3=83=C2=A9ric=20Bu?= =?UTF-8?q?clin=20=20r/a=3Dmkanat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.0.0.236/trunk@249785 18797224-902f-48f8-a5cc-f745e15eee43 --- .../bugzilla/Bugzilla/Install/Requirements.pm | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/mozilla/webtools/bugzilla/Bugzilla/Install/Requirements.pm b/mozilla/webtools/bugzilla/Bugzilla/Install/Requirements.pm index 558db88e286..0bfa9ec87ba 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Install/Requirements.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Install/Requirements.pm @@ -54,11 +54,14 @@ use Bugzilla::Constants; # are 'blacklisted'--that is, even if the version is high enough, Bugzilla # will refuse to say that it's OK to run with that version. sub REQUIRED_MODULES { + my $perl_ver = sprintf('%vd', $^V); my @modules = ( { package => 'CGI', module => 'CGI', - version => '2.93' + # Perl 5.10 requires CGI 3.33 due to a taint issue when + # uploading attachments, see bug 416382. + version => (vers_cmp($perl_ver, '5.10') > -1) ? '3.33' : '2.93' }, { package => 'TimeDate', @@ -222,16 +225,20 @@ sub OPTIONAL_MODULES { version => '1.999022', feature => 'mod_perl' }, + ); + # Even very new releases of perl (5.8.5) don't come with this version, # so I didn't want to make it a general requirement just for # running under mod_cgi. - { - package => 'CGI', - module => 'CGI', - version => '3.11', - feature => 'mod_perl' - }, - ); + # If Perl 5.10 is installed, then CGI 3.33 is already required. So this + # check is only relevant with Perl 5.8.x. + my $perl_ver = sprintf('%vd', $^V); + if (vers_cmp($perl_ver, '5.10') < 0) { + push(@modules, { package => 'CGI', + module => 'CGI', + version => '3.11', + feature => 'mod_perl' }); + } my $all_modules = _get_extension_requirements( 'OPTIONAL_MODULES', \@modules);