From: bugreport%peshkin.net <> Date: Sun, 22 Dec 2002 05:11:56 +0000 (+0000) Subject: Bug 186383 Checksetup leaves editor backups of localconfig accessible X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1a3971d720e460df84ab667c1b198f961dc2a147;p=thirdparty%2Fbugzilla.git Bug 186383 Checksetup leaves editor backups of localconfig accessible r=zach a=justdave --- diff --git a/checksetup.pl b/checksetup.pl index 64a275d8bb..e0f77def98 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -569,12 +569,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 - + deny 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)(\|)/$1.*$2/) { + print "Repairing .htaccess...\n"; + open HTACCESS, ">.htaccess"; + print HTACCESS $oldaccess; + close HTACCESS; + } + } if (!-e "data/.htaccess") { print "Creating data/.htaccess...\n";