From 0481e9aa5d957665c206c9de1efc8c7f8c56cb4c Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Sat, 22 May 2010 22:08:02 -0700 Subject: Bug 560733: Move the base .htaccess file into bzr instead of having it generated by checksetup.pl r=LpSolit, a=mkanat --- .htaccess | 4 ++++ Bugzilla/Install/Filesystem.pm | 42 ++---------------------------------------- 2 files changed, 6 insertions(+), 40 deletions(-) create mode 100644 .htaccess diff --git a/.htaccess b/.htaccess new file mode 100644 index 000000000..72a96e064 --- /dev/null +++ b/.htaccess @@ -0,0 +1,4 @@ +# Don't allow people to retrieve non-cgi executable files or our private data + + deny from all + diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm index 4dc8a484d..eb959f0f3 100644 --- a/Bugzilla/Install/Filesystem.pm +++ b/Bugzilla/Install/Filesystem.pm @@ -279,14 +279,8 @@ EOT contents => HT_DEFAULT_DENY }, 't/.htaccess' => { perms => $ws_readable, contents => HT_DEFAULT_DENY }, - - '.htaccess' => { perms => $ws_readable, contents => < - deny from all - -EOT - }, + "$datadir/.htaccess" => { perms => $ws_readable, + contents => HT_DEFAULT_DENY }, "$webdotdir/.htaccess" => { perms => $ws_readable, contents => < { perms => $ws_readable, contents => <{htaccess}}); # Repair old .htaccess files - my $htaccess = new IO::File('.htaccess', 'r') || die ".htaccess: $!"; - my $old_data; - { local $/; $old_data = <$htaccess>; } - $htaccess->close; - - my $repaired = 0; - if ($old_data =~ s/\|localconfig\|/\|.*localconfig.*\|/) { - $repaired = 1; - } - if ($old_data !~ /\(\.\*\\\.pm\|/) { - $old_data =~ s/\(/(.*\\.pm\|/; - $repaired = 1; - } - if ($repaired) { - print "Repairing .htaccess...\n"; - $htaccess = new IO::File('.htaccess', 'w') || die $!; - print $htaccess $old_data; - $htaccess->close; - } - my $webdot_dir = bz_locations()->{'webdotdir'}; # The public webdot IP address changed. -- cgit v1.2.3-24-g4f1b