summaryrefslogtreecommitdiff
path: root/src/mod_access.c
diff options
context:
space:
mode:
authorJan Kneschke <jan@kneschke.de>2006-01-14 17:47:17 +0000
committerJan Kneschke <jan@kneschke.de>2006-01-14 17:47:17 +0000
commit6842dbb724bace8ab5a438c102c715281494a8d0 (patch)
tree64de88de36a61c8e5fd9e16325c6db4fd065382e /src/mod_access.c
parentab4fddbda10c8a632d262c82f51d3d32b97fc9d7 (diff)
downloadlighttpd1.4-6842dbb724bace8ab5a438c102c715281494a8d0.tar.gz
lighttpd1.4-6842dbb724bace8ab5a438c102c715281494a8d0.zip
added tests for lowercase filesysytems
made mod_access aware of lowercase filesystems git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@948 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'src/mod_access.c')
-rw-r--r--src/mod_access.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/mod_access.c b/src/mod_access.c
index aa8d16f5..f3f70718 100644
--- a/src/mod_access.c
+++ b/src/mod_access.c
@@ -129,11 +129,21 @@ URIHANDLER_FUNC(mod_access_uri_handler) {
if (ct_len > s_len) continue;
if (ds->value->used == 0) continue;
-
- if (0 == strncmp(con->uri.path->ptr + s_len - ct_len, ds->value->ptr, ct_len)) {
- con->http_status = 403;
+
+ /* if we have a case-insensitive FS we have to lower-case the URI here too */
+
+ if (con->conf.force_lowercase_filenames) {
+ if (0 == strncasecmp(con->uri.path->ptr + s_len - ct_len, ds->value->ptr, ct_len)) {
+ con->http_status = 403;
- return HANDLER_FINISHED;
+ return HANDLER_FINISHED;
+ }
+ } else {
+ if (0 == strncmp(con->uri.path->ptr + s_len - ct_len, ds->value->ptr, ct_len)) {
+ con->http_status = 403;
+
+ return HANDLER_FINISHED;
+ }
}
}