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
This commit is contained in:
bugreport%peshkin.net
2002-12-23 01:53:34 +00:00
parent e9306419fd
commit bc4685bc33

View File

@@ -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
<FilesMatch ^(.*\.pl|localconfig|processmail|runtests.sh)$>
<FilesMatch ^(.*\.pl|.*localconfig.*|processmail|runtests.sh)$>
deny from all
</FilesMatch>
<FilesMatch ^(localconfig.js|localconfig.rdf)$>
allow 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\|/\|.*localconfig.*\|/) {
print "Repairing .htaccess...\n";
open HTACCESS, ">.htaccess";
print HTACCESS $oldaccess;
print HTACCESS <<'END';
<FilesMatch ^(localconfig.js|localconfig.rdf)$>
allow from all
</FilesMatch>
END
close HTACCESS;
}
}
if (!-e "Bugzilla/.htaccess") {
print "Creating Bugzilla/.htaccess...\n";