[Pkg-bugzilla-commits] r74 - trunk/bugzilla-2.18/Bugzilla
Alexis Sukrieh
sukria-guest@costa.debian.org
Sat, 23 Apr 2005 15:00:48 +0000
Author: sukria-guest
Date: 2005-04-23 15:00:47 +0000 (Sat, 23 Apr 2005)
New Revision: 74
Modified:
trunk/bugzilla-2.18/Bugzilla/Config.pm
Log:
Restoring original Bugzilla/Config.pm file
Modified: trunk/bugzilla-2.18/Bugzilla/Config.pm
===================================================================
--- trunk/bugzilla-2.18/Bugzilla/Config.pm 2005-04-23 14:59:19 UTC (rev 73)
+++ trunk/bugzilla-2.18/Bugzilla/Config.pm 2005-04-23 15:00:47 UTC (rev 74)
@@ -56,7 +56,6 @@
our $datadir = "$libpath/web/data";
our $templatedir = "$libpath/template";
our $webdotdir = "$datadir/webdot";
-our $params_file = "/etc/bugzilla/params";
# Module stuff
@Bugzilla::Config::EXPORT = qw(Param);
@@ -106,22 +105,22 @@
# read in localconfig variables
do $localconfig;
- if (-e $params_file) {
+ if (-e "$datadir/params") {
# Handle reading old param files by munging the symbol table
# Don't have to do this if we use safe mode, since its evaled
# in a sandbox where $foo is in the same module as $::foo
#local *::param = \%param;
- # Note that checksetup.pl sets file permissions on $params_file
+ # Note that checksetup.pl sets file permissions on '$datadir/params'
# Using Safe mode is _not_ a guarantee of safety if someone does
# manage to write to the file. However, it won't hurt...
# See bug 165144 for not needing to eval this at all
my $s = new Safe;
- $s->rdo($params_file);
- die "Error reading $params_file: $!" if $!;
- die "Error evaluating $params_file: $@" if $@;
+ $s->rdo("$datadir/params");
+ die "Error reading $datadir/params: $!" if $!;
+ die "Error evaluating $datadir/params: $@" if $@;
# Now read the param back out from the sandbox
%param = %{$s->varglob('param')};
@@ -261,21 +260,13 @@
print $fh (Data::Dumper->Dump([ \%param ], [ '*param' ]))
|| die "Can't write param file: $!";
+
close $fh;
- # We write it by hand
- # this works really better than the original rename() call
- # and will prevent overwriting of symlinks.
- open TMPFILE, "<$tmpname" or die "$!";
- open PARAMSFILE, ">$params_file" or die $!;
- while (<TMPFILE>) {
- print PARAMSFILE $_;
- }
- close TMPFILE;
- close PARAMSFILE;
- unlink $tmpname;
+ rename $tmpname, "$datadir/params"
+ || die "Can't rename $tmpname to $datadir/params: $!";
- ChmodDataFile($params_file, 0666);
+ ChmodDataFile("$datadir/params", 0666);
}
# Some files in the data directory must be world readable iff we don't have