From 5fcefed7417cd3580fc0779afb2793fac257d94b Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 21 May 2008 05:00:57 +0000 Subject: Bug 380756: Remove duplicates.xul (and all the code related to it) - Patch by Frédéric Buclin r=mkanat a=LpSolit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Install/Filesystem.pm | 11 +++--- collectstats.pl | 26 ------------- docs/en/xml/security.xml | 69 +++++++-------------------------- duplicates.cgi | 13 ------- template/en/default/filterexceptions.pl | 7 ---- 5 files changed, 21 insertions(+), 105 deletions(-) diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm index c19cef403..8c6e7d52e 100644 --- a/Bugzilla/Install/Filesystem.pm +++ b/Bugzilla/Install/Filesystem.pm @@ -287,12 +287,8 @@ EOT # It's harmless if it isn't accessible... "$datadir/.htaccess" => { perms => $ws_readable, contents => < - allow from all - EOT @@ -371,6 +367,11 @@ EOT unlink "$datadir/versioncache"; } + if (-e "$datadir/duplicates.rdf") { + print "Removing duplicates.rdf...\n"; + unlink "$datadir/duplicates.rdf"; + unlink "$datadir/duplicates-old.rdf"; + } } # A simple helper for creating "empty" CSS files. diff --git a/collectstats.pl b/collectstats.pl index 4515b424c..4c66810a0 100755 --- a/collectstats.pl +++ b/collectstats.pl @@ -134,32 +134,6 @@ my $tend = time; CollectSeriesData(); -{ - local $ENV{'GATEWAY_INTERFACE'} = 'cmdline'; - local $ENV{'REQUEST_METHOD'} = 'GET'; - local $ENV{'QUERY_STRING'} = 'ctype=rdf'; - - my $perl = $^X; - trick_taint($perl); - - # Generate a static RDF file containing the default view of the duplicates data. - open(CGI, "$perl -T duplicates.cgi |") - || die "can't fork duplicates.cgi: $!"; - open(RDF, ">$datadir/duplicates.tmp") - || die "can't write to $datadir/duplicates.tmp: $!"; - my $headers_done = 0; - while () { - print RDF if $headers_done; - $headers_done = 1 if $_ eq "\r\n"; - } - close CGI; - close RDF; -} -if (-s "$datadir/duplicates.tmp") { - rename("$datadir/duplicates.rdf", "$datadir/duplicates-old.rdf"); - rename("$datadir/duplicates.tmp", "$datadir/duplicates.rdf"); -} - sub check_data_dir { my $dir = shift; diff --git a/docs/en/xml/security.xml b/docs/en/xml/security.xml index b6bd0bcc8..f1835a333 100644 --- a/docs/en/xml/security.xml +++ b/docs/en/xml/security.xml @@ -1,5 +1,5 @@ - + Bugzilla Security @@ -57,7 +57,7 @@ You will need to set the option - in localconfig to the group your webserver runs + in localconfig to the group your web server runs as. This will allow ./checksetup.pl to set file permissions on Unix systems so that nothing is world-writable. @@ -137,7 +137,7 @@
Network Access - If MySQL and your webserver both run on the same machine and you + If MySQL and your web server both run on the same machine and you have no other reason to access MySQL remotely, then you should disable the network access. This, along with the suggestion in , will help protect your system from @@ -171,20 +171,19 @@ skip-networking
- Webserver + Web server
Disabling Remote Access to Bugzilla Configuration Files - There are many files that are placed in the Bugzilla directory - area that should not be accessable from the web. Because of the way - Bugzilla is currently layed out, the list of what should and should not - be accessible is rather complicated. A new installation method is - currently in the works which should solve this by allowing files that - shouldn't be accessible from the web to be placed in a directory outside - the webroot. See - bug 44659 - for more information. + + There are many files that are placed in the Bugzilla directory + area that should not be accessible from the web server. Because of the way + Bugzilla is currently layed out, the list of what should and should not + be accessible is rather complicated. A quick way is to run + testserver.pl to check if your web server serves + Bugzilla files as expected. If not, you may want to follow the few + steps below. @@ -216,13 +215,6 @@ skip-networking Block everything - - But allow: - - duplicates.rdf - - - @@ -296,52 +288,21 @@ skip-networking properly blocked. Of particular interest is the localconfig file which contains your database password. Also, be aware that many editors create temporary and backup files in the working directory and that - those should also not be accessable. For more information, see + those should also not be accessible. For more information, see bug 186383 or Bugtraq ID 6501. - To test, simply point your web browser at the file; for example, to - test mozilla.org's installation, we'd try to access - . You should get - a 403 Forbidden - error. + To test, simply run testserver.pl, as said above. Be sure to check for instructions - specific to the webserver you use. + specific to the web server you use.
- -
- Using <filename>mod_throttle</filename> to Prevent a DOS - - - This section only applies to people who have chosen the Apache - webserver. It may be possible to do similar things with other - webservers. Consult the documentation that came with your webserver - to find out. - - - - It is possible for a user, by mistake or on purpose, to access - the database many times in a row which can result in very slow access - speeds for other users (effectively, a - DOS attack). If your - Bugzilla installation is experiencing this problem, you may install - the Apache module mod_throttle which can limit - connections by IP address. You may download this module at - . - Follow the instructions to install into your Apache install. - The command you need is - ThrottleClientIP. See the - documentation - for more information. -
-
diff --git a/duplicates.cgi b/duplicates.cgi index 32553a39d..06334e22b 100755 --- a/duplicates.cgi +++ b/duplicates.cgi @@ -37,19 +37,6 @@ use Bugzilla::Search; use Bugzilla::Product; my $cgi = Bugzilla->cgi; - -# Go directly to the XUL version of the duplicates report (duplicates.xul) -# if the user specified ctype=xul. Adds params if they exist, and directs -# the user to a signed copy of the script in duplicates.jar if it exists. -if (defined $cgi->param('ctype') && $cgi->param('ctype') eq "xul") { - my $params = CanonicaliseParams($cgi->query_string(), ["format", "ctype"]); - my $url = (-e "duplicates.jar" ? "duplicates.jar!/" : "") . - "duplicates.xul" . ($params ? "?$params" : "") . "\n\n"; - - print $cgi->redirect($url); - exit; -} - my $template = Bugzilla->template; my $vars = {}; diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl index c25e400c3..3ff80568f 100644 --- a/template/en/default/filterexceptions.pl +++ b/template/en/default/filterexceptions.pl @@ -148,13 +148,6 @@ 'cumulate', ], -'reports/duplicates.rdf.tmpl' => [ - 'template_version', - 'bug.id', - 'bug.count', - 'bug.delta', -], - 'reports/chart.html.tmpl' => [ 'width', 'height', -- cgit v1.2.3-24-g4f1b