summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Config.pm
diff options
context:
space:
mode:
authorReed Loden <reed@reedloden.com>2010-02-01 22:27:08 +0100
committerMax Kanat-Alexander <mkanat@bugzilla.org>2010-02-01 22:27:08 +0100
commit9a80c1fffa48ef6d9301ba64a9bd02b4d5448dc2 (patch)
tree17ce8bffc3fe6534ba4a38aa4c186ff0349f7dc5 /Bugzilla/Config.pm
parent532196b8689286cf4e65b58c98afa95ca910d7ac (diff)
downloadbugzilla-9a80c1fffa48ef6d9301ba64a9bd02b4d5448dc2.tar.gz
bugzilla-9a80c1fffa48ef6d9301ba64a9bd02b4d5448dc2.tar.xz
Bug 434801: [SECURITY] .htaccess doesn't prevent reading old-params.txt from the web
Patch by Reed Loden <reed@reedloden.com> r=mkanat a=LpSolit
Diffstat (limited to 'Bugzilla/Config.pm')
-rw-r--r--Bugzilla/Config.pm11
1 files changed, 7 insertions, 4 deletions
diff --git a/Bugzilla/Config.pm b/Bugzilla/Config.pm
index 0361592bf..a7184866f 100644
--- a/Bugzilla/Config.pm
+++ b/Bugzilla/Config.pm
@@ -221,7 +221,7 @@ sub update_params {
# --- REMOVE OLD PARAMS ---
my %oldparams;
- # Remove any old params, put them in old-params.txt
+ # Remove any old params
foreach my $item (keys %$param) {
if (!grep($_ eq $item, map ($_->{'name'}, @param_list))) {
$oldparams{$item} = $param->{$item};
@@ -229,13 +229,16 @@ sub update_params {
}
}
+ # Write any old parameters to old-params.txt
+ my $datadir = bz_locations()->{'datadir'};
+ my $old_param_file = "$datadir/old-params.txt";
if (scalar(keys %oldparams)) {
- my $op_file = new IO::File('old-params.txt', '>>', 0600)
- || die "old-params.txt: $!";
+ my $op_file = new IO::File($old_param_file, '>>', 0600)
+ || die "Couldn't create $old_param_file: $!";
print "The following parameters are no longer used in Bugzilla,",
" and so have been\nmoved from your parameters file into",
- " old-params.txt:\n";
+ " $old_param_file:\n";
local $Data::Dumper::Terse = 1;
local $Data::Dumper::Indent = 0;