Bug #2042

WinXP case folding problem (with hgwebdir.cgi script)

Added by mikahe over 5 years ago. Updated over 4 years ago.

Status:FixedStart date:2009-07-26
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:-
Target version:1.4.27
Missing in 1.5.x:No

Description

Files (and directories) can't be loaded when hosting Mercurial repositories in WinXP using LightTPD (versions 1.4.13 to 1.4.23-1 Win32-SSL versions tested) if they contain capital letters. Lower case names work ok. Same problem does not occur in Linux version 1.3.19 (ssl). This is possibly related to file/dir name case folding, e.g. File1.txt->file1.txt (full trace attached):

2009-07-26 04:51:10: (response.c.391) -- before doc_root
2009-07-26 04:51:10: (response.c.392) Doc-Root : C:/work/repo/
2009-07-26 04:51:10: (response.c.393) Rel-Path : /hgwebdir.cgi/dummytest/mercurialdummytest/file/3e4033101a00/File1.txt
2009-07-26 04:51:10: (response.c.394) Path :
2009-07-26 04:51:10: (response.c.442) -- after doc_root
2009-07-26 04:51:10: (response.c.443) Doc-Root : C:/work/repo/
2009-07-26 04:51:10: (response.c.444) Rel-Path : /hgwebdir.cgi/dummytest/mercurialdummytest/file/3e4033101a00/file1.txt
2009-07-26 04:51:10: (response.c.445) Path : C:/work/repo/hgwebdir.cgi/dummytest/mercurialdummytest/file/3e4033101a00/file1.txt
:
2009-07-26 04:51:15: (response.c.126) Response-Header:
HTTP/1.1 404 Not Found

LightTPD_win32_case_folding.txt Magnifier (3.45 KB) mikahe, 2009-07-26 08:37

lighttpd-me.conf Magnifier (11.7 KB) mikahe, 2009-07-26 08:37

Associated revisions

Revision 2757
Added by stbuehler over 4 years ago

don't overwrite global server.force-lowercase-filenames setting (fixes #2042)

History

#1 Updated by mikahe over 5 years ago

Correct Linux version is 1.4.19 (ssl)

#2 Updated by mikahe over 5 years ago

Module response.c (1.4.23) lines 412-418 seem to cause this:

/* MacOS X and Windows can't distiguish between upper and lower-case
 *
 * convert to lower-case
*/
if (con->conf.force_lowercase_filenames) {
buffer_to_lower(con->physical.rel_path);
}
However, adding conf option
server.force-lowercase-filenames = "disable"

didn't seem to disable this feature.

#3 Updated by mikahe over 5 years ago

It looks like removing the quoted response.c lines fix the problem (v.1.4.13 tested as there are some Cygwin build problems with 1.4.23 (/w Cygwin version 1005.25.0.0/1.5.25-15).

This might cause some other issues, so this is by no means a proper fix.

#4 Updated by byates about 5 years ago

  • Target version set to 1.4.24

I am seeing the exact same problem. It would be nice if when server.force-lowercase-filenames was set to "disable" NO filenames would be forced to lowercase. While this might present a security issue, it would be an acceptable fix.

#5 Updated by stbuehler about 5 years ago

  • Target version changed from 1.4.24 to 1.4.x
  • Missing in 1.5.x set to No

#6 Updated by stbuehler over 4 years ago

  • Target version changed from 1.4.x to 1.4.27

I really think it is stupid to use lighty on windows (and i think it is stupid to use case-insensitive filesystems).

I still will try to patch it so it doesn't overwrite the lowercase option...

#7 Updated by stbuehler over 4 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset r2757.

Also available in: Atom