]> 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:11:56 +0000 (05:11 +0000)
committerbugreport%peshkin.net <>
Sun, 22 Dec 2002 05:11:56 +0000 (05:11 +0000)
r=zach
a=justdave

checksetup.pl

index 64a275d8bb9ee9c974038da1668a3a0864ad80af..e0f77def981665782afc1d11874ed73eff1bd533 100755 (executable)
@@ -569,12 +569,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|syncshadowdb)$>
+<FilesMatch ^(.*\.pl|localconfig.*|processmail|syncshadowdb)$>
   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 "data/.htaccess") {
     print "Creating data/.htaccess...\n";