Bug #306
closedlighttpd 1.4.4 can not serve files and directories in upper case
Description
lighttpd always return Error 404, if there is just one uppercase symbol in the path.
Not just in the file type extension (as is http://trac.lighttpd.net/trac/changeset/632).
May be at some point the whole path is converted to lower case, but I can't find anywhere call to tolower() function.
I try strace and when request is http://example.com/Picture.gif, in the log-file there is line:
stat64("/example.com/picture.gif", 0xbfff308c) = -1 ENOENT (No such file or directory)
I try to use version 1.4.3, but the result is the same.
I don't understand why first have to convert the path to lower case (it take some time), and then use strncasecmp (slower), instead strncmp (faster).
Updated by jan over 19 years ago
- Status changed from New to Assigned
The transition to lower case is done on filesystem which are case-insensitive. It the start of lighttpd this is tested. The filesystems of Windows and MacOS X are know to be case-insensitive. On those platforms EXAMPLE.TXT and example.txt are the same file.
Which OS are you using and which file-systems ?
Updated by jan over 19 years ago
I need a full strace() from the startup.
In configfile.c, line 1061 is the check if the document.root can be accessed in upper- and lower-case and if both have the same inode. In response.c, Line 327 is the transition to lower-case of the initial test failed and the FS is case-insensitive.
Updated by jan over 19 years ago
1. it is a if () covering the tolower(), no processor time is waste on linux
2. all windows file-systems, HPFS on MacOS X and all samba-shares have this problem
3. there is a security problem behind it
Also available in: Atom