diff options
author | bugreport%peshkin.net <> | 2002-12-22 06:04:05 +0100 |
---|---|---|
committer | bugreport%peshkin.net <> | 2002-12-22 06:04:05 +0100 |
commit | eec74369a663d83f168b5cabad636bc89b3f0fd1 (patch) | |
tree | bc354eb8afe38d7d049bc47bb5ed3025485a65a0 /checksetup.pl | |
parent | 1b2aa767929784a37212b9e3dc01f9e119c4a9d6 (diff) | |
download | bugzilla-eec74369a663d83f168b5cabad636bc89b3f0fd1.tar.gz bugzilla-eec74369a663d83f168b5cabad636bc89b3f0fd1.tar.xz |
Bug 186383 Checksetup leaves editor backups of localconfig accessible
r=zach
a=justdave
Diffstat (limited to 'checksetup.pl')
-rwxr-xr-x | checksetup.pl | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/checksetup.pl b/checksetup.pl index 18b45dda5..6a49f3949 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -820,12 +820,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 -<FilesMatch ^(.*\.pl|localconfig|processmail|runtests.sh)$> +<FilesMatch ^(.*\.pl|localconfig.*|processmail|runtests.sh)$> deny 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)(\|)/$1.*$2/) { + print "Repairing .htaccess...\n"; + open HTACCESS, ">.htaccess"; + print HTACCESS $oldaccess; + close HTACCESS; + } + } if (!-e "Bugzilla/.htaccess") { print "Creating Bugzilla/.htaccess...\n"; |