From: bugreport%peshkin.net <> Date: Mon, 23 Dec 2002 09:52:11 +0000 (+0000) Subject: Bug 186383 Checksetup leaves editor backups of localconfig accessible (revised) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62c6d4e74729320bbf3819d61b4c6e3422e1b978;p=thirdparty%2Fbugzilla.git Bug 186383 Checksetup leaves editor backups of localconfig accessible (revised) --- diff --git a/checksetup.pl b/checksetup.pl index 64a275d8bb..b5b414859f 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -569,12 +569,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 "data/.htaccess") { print "Creating data/.htaccess...\n";