Replace mixed directives and deny from env

This commit is contained in:
Brice Waegeneire 2021-02-01 16:57:44 +01:00
parent cf2017a863
commit b17ae68672

5
convert.pl Normal file → Executable file
View file

@ -31,6 +31,8 @@ while (<>) {
# replaced with the current one down the line.
s/${1}${s}(Deny${s}from${s}all)/$1/i;
s/${1}${s}(Allow${s}from${s}localhost.*)/$1/i;
# When someone was mixing directives
s/${1}${s}(Require*)/$1/i;
};
# ** Satisfy
@ -50,7 +52,8 @@ while (<>) {
s/Deny${s}from${s}all/Require all denied/i;
};
s/Deny${s}from${s}env=/Require not env /i;
# https://bz.apache.org/bugzilla/show_bug.cgi?id=60946
s/Deny${s}from${s}env=(!?)(\S+)/ "Require expr \"-".( $1 ? "n" : "z")." %{reqenv:$2}\""/ei;
# ** Allow
s/Allow${s}from${s}all/Require all granted/i;