diff options
author | bugreport%peshkin.net <> | 2002-12-23 10:49:07 +0100 |
---|---|---|
committer | bugreport%peshkin.net <> | 2002-12-23 10:49:07 +0100 |
commit | 1be7ce91dafe74df3db6d96c415dead9a68ce327 (patch) | |
tree | 44f7399b79b35d390fb0892af91db8448fe25941 | |
parent | 0e1c51a6945e1b3baab9bbb6c96e8a11e92d6bb0 (diff) | |
download | bugzilla-1be7ce91dafe74df3db6d96c415dead9a68ce327.tar.gz bugzilla-1be7ce91dafe74df3db6d96c415dead9a68ce327.tar.xz |
Bug 186383 Checksetup leaves editor backups of localconfig accessible (revised)
r=jaypee
a=justdave
-rwxr-xr-x | checksetup.pl | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/checksetup.pl b/checksetup.pl index 18b45dda5..a79b78a0d 100755 --- a/checksetup.pl +++ b/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 -<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"; |