]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 319241: Bugzilla.pm is freely accessible from the web - Patch by Frédéric Buclin...
authorlpsolit%gmail.com <>
Mon, 12 Dec 2005 11:02:01 +0000 (11:02 +0000)
committerlpsolit%gmail.com <>
Mon, 12 Dec 2005 11:02:01 +0000 (11:02 +0000)
checksetup.pl

index 04e0583c5476da05561b7c18d63094924751a9fe..98acb8f604663700f9072aee0c124e88a105b30d 100755 (executable)
@@ -992,7 +992,7 @@ if ($my_create_htaccess) {
     open HTACCESS, '>', '.htaccess';
     print HTACCESS <<'END';
 # don't allow people to retrieve non-cgi executable files or our private data
-<FilesMatch ^(.*\.pl|.*localconfig.*)$>
+<FilesMatch ^(.*\.pm|.*\.pl|.*localconfig.*)$>
   deny from all
 </FilesMatch>
 <FilesMatch ^(localconfig.js|localconfig.rdf)$>
@@ -1009,7 +1009,15 @@ END
       $oldaccess .= $_;
     }
     close HTACCESS;
+    my $repaired = 0;
     if ($oldaccess =~ s/\|localconfig\|/\|.*localconfig.*\|/) {
+        $repaired = 1;
+    }
+    if ($oldaccess !~ /\(\.\*\\\.pm\|/) {
+        $oldaccess =~ s/\(/(.*\\.pm\|/;
+        $repaired = 1;
+    }
+    if ($repaired) {
       print "Repairing .htaccess...\n";
       open HTACCESS, '>', '.htaccess';
       print HTACCESS $oldaccess;