From bc4685bc3370bc16ad25e6a4dc7e2f1328b44237 Mon Sep 17 00:00:00 2001 From: "bugreport%peshkin.net" Date: Mon, 23 Dec 2002 01:53:34 +0000 Subject: [PATCH] Bug 186383 Checksetup leaves editor backups of localconfig accessible (revised) r=jaypee a=justdave git-svn-id: svn://10.0.0.236/trunk@135578 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/checksetup.pl | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/mozilla/webtools/bugzilla/checksetup.pl b/mozilla/webtools/bugzilla/checksetup.pl index 18b45dda5a4..a79b78a0d6b 100755 --- a/mozilla/webtools/bugzilla/checksetup.pl +++ b/mozilla/webtools/bugzilla/checksetup.pl @@ -820,12 +820,35 @@ 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 + + allow 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\|/\|.*localconfig.*\|/) { + print "Repairing .htaccess...\n"; + open HTACCESS, ">.htaccess"; + print HTACCESS $oldaccess; + print HTACCESS <<'END'; + + allow from all + +END + close HTACCESS; + } + } if (!-e "Bugzilla/.htaccess") { print "Creating Bugzilla/.htaccess...\n";