]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 186383 Checksetup leaves editor backups of localconfig accessible
authorbugreport%peshkin.net <>
Sun, 22 Dec 2002 05:04:05 +0000 (05:04 +0000)
committerbugreport%peshkin.net <>
Sun, 22 Dec 2002 05:04:05 +0000 (05:04 +0000)
r=zach
a=justdave

checksetup.pl

index 18b45dda5a469b54d1563f85599eb91c25e9f8a8..6a49f3949be895ff44d87a96969f6fd29b658a44 100755 (executable)
@@ -820,12 +820,27 @@ 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|processmail|runtests.sh)$>
+<FilesMatch ^(.*\.pl|localconfig.*|processmail|runtests.sh)$>
   deny from all
 </FilesMatch>
 END
     close HTACCESS;
     chmod $fileperm, ".htaccess";
+  } else {
+    # 2002-12-21 Bug 186383
+    open HTACCESS, ".htaccess";
+    my $oldaccess = "";
+    while (<HTACCESS>) {
+      $oldaccess .= $_;
+    }
+    close HTACCESS;
+    if ($oldaccess =~ s/(localconfig)(\|)/$1.*$2/) {
+      print "Repairing .htaccess...\n";
+      open HTACCESS, ">.htaccess";
+      print HTACCESS $oldaccess;
+      close HTACCESS;
+    }
+
   }
   if (!-e "Bugzilla/.htaccess") {
     print "Creating Bugzilla/.htaccess...\n";