This project is read-only.
1
Vote

REQUEST_FILENAME is empty if full path is longer than 127 chars (iirf 2.0)

description

I'm still working with IIRF 2.0 and ran into this issue (on my system at least): if a full path to some file is longer than 127 chars, the REQUEST_FILENAME server variable results in an empty string (even though the log shows it is able to count the variable's length). Obviously this breaks the pretty common rule/condition %{REQUEST_FILENAME} !-f.

This is what I see in the logs (with level 5, nice work by the way, these logs are very helpful):

Thu Oct 08 11:46:17 - 2452 - GetServerVariable: getting 'REQUEST_FILENAME'
Thu Oct 08 11:46:17 - 2452 - GetServerVariable: special variable name
Thu Oct 08 11:46:17 - 2452 - GetServerVariable: 128 bytes
Thu Oct 08 11:46:17 - 2452 - GetServerVariable: result ''
Thu Oct 08 11:46:17 - 2452 - ReplaceServerVariables: VariableName='REQUEST_FILENAME' Value=''
Thu Oct 08 11:46:17 - 2452 - ReplaceServerVariables: in='%{REQUEST_FILENAME}' out=''

If I drop only one char anywhere along the file path (directory or file), the variable is filled correctly:

Thu Oct 08 11:46:13 - 2884 - GetServerVariable: getting 'REQUEST_FILENAME'
Thu Oct 08 11:46:13 - 2884 - GetServerVariable: special variable name
Thu Oct 08 11:46:13 - 2884 - GetServerVariable: 127 bytes
Thu Oct 08 11:46:13 - 2884 - GetServerVariable: result 'file path of exactly 127 chars long'
Thu Oct 08 11:46:13 - 2884 - ReplaceServerVariables: VariableName='REQUEST_FILENAME' Value='file path of exactly 127 chars long'
Thu Oct 08 11:46:13 - 2884 - ReplaceServerVariables: in='%{REQUEST_FILENAME}' out='file path of exactly 127 chars long'

Is there an easy way to fix this with some configuration value? If not, I realize that 2.0 is an old version, you might not have the time (or interest) to fix this. I just wanted to make note of this issue, in case someone else runs into it as well. The advice being: don't host a site with too deep a structure :-)

Greetings,

Jan Willem

comments