From 1b39921993f4191ff86d464966f36deed9c12b3c Mon Sep 17 00:00:00 2001 From: "bugreport%peshkin.net" <> Date: Sun, 22 Dec 2002 05:16:49 +0000 Subject: [PATCH] Bug 186383 Checksetup leaves editor backups of localconfig accessible r=zach a=justdave --- checksetup.pl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/checksetup.pl b/checksetup.pl index 4d3c1e1587..66dce8744d 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -754,12 +754,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 - + deny from all END close HTACCESS; chmod $fileperm, ".htaccess"; + } else { + # 2002-12-21 Bug 186383 + open HTACCESS, ".htaccess"; + my $oldaccess = ""; + while () { + $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"; -- 2.47.2