]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 560733: Move the base .htaccess file into bzr instead of having it
authorMax Kanat-Alexander <mkanat@bugzilla.org>
Sun, 23 May 2010 05:08:02 +0000 (22:08 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Sun, 23 May 2010 05:08:02 +0000 (22:08 -0700)
generated by checksetup.pl
r=LpSolit, a=mkanat

.htaccess [new file with mode: 0644]
Bugzilla/Install/Filesystem.pm

diff --git a/.htaccess b/.htaccess
new file mode 100644 (file)
index 0000000..72a96e0
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1,4 @@
+# Don't allow people to retrieve non-cgi executable files or our private data
+<FilesMatch ^(.*\.pm|.*\.pl|.*localconfig.*)$>
+  deny from all
+</FilesMatch>
index 4dc8a484d240f1a14158ea16902b3af2f815a009..eb959f0f3bc3d651698fae2ebe84db3dc0788a9f 100644 (file)
@@ -279,14 +279,8 @@ EOT
                                           contents => HT_DEFAULT_DENY },
         't/.htaccess'                => { perms    => $ws_readable,
                                           contents => HT_DEFAULT_DENY },
-
-        '.htaccess' => { perms => $ws_readable, contents => <<EOT
-# Don't allow people to retrieve non-cgi executable files or our private data
-<FilesMatch ^(.*\\.pm|.*\\.pl|.*localconfig.*)\$>
-  deny from all
-</FilesMatch>
-EOT
-        },
+        "$datadir/.htaccess"         => { perms    => $ws_readable,
+                                          contents => HT_DEFAULT_DENY },
 
         "$webdotdir/.htaccess" => { perms => $ws_readable, contents => <<EOT
 # Restrict access to .dot files to the public webdot server at research.att.com
@@ -306,18 +300,6 @@ EOT
 Deny from all
 EOT
         },
-
-        # Even though $datadir may not (and should not) be accessible from the 
-        # web server, we can't know for sure, so create the .htaccess anyway. 
-        # It's harmless if it isn't accessible...
-        "$datadir/.htaccess" => { perms    => $ws_readable, contents => <<EOT
-# Nothing in this directory is retrievable unless overridden by an .htaccess
-# in a subdirectory.
-deny from all
-EOT
-
-
-        },
     );
 
     my %all_files = (%create_files, %htaccess, %index_html, %files);
@@ -433,26 +415,6 @@ sub create_htaccess {
     _create_files(%{FILESYSTEM()->{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.