Browse Source

[core] allow files to be used as document-root (fixes #2475)

From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2900 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.33
Stefan Bühler 9 years ago
parent
commit
9cfc080ab7
  1. 1
      NEWS
  2. 3
      src/mod_alias.c
  3. 2
      src/response.c

1
NEWS

@ -32,6 +32,7 @@ NEWS
* [core] check whether server.chroot exists
* [mod_simple_vhost] fix cache; skip module if simple-vhost.server-root is empty (thx rm for reporting)
* [mod_accesslog] add accesslog.syslog-level option (fixes #2480)
* [core] allow files to be used as document-root (fixes #2475)
- 1.4.32 - 2012-11-21
* Code cleanup with clang/sparse (fixes #2437, thx kibi)

3
src/mod_alias.c

@ -156,7 +156,8 @@ PHYSICALPATH_FUNC(mod_alias_physical_handler) {
mod_alias_patch_connection(srv, con, p);
/* not to include the tailing slash */
basedir_len = (con->physical.basedir->used - 1) - 1;
basedir_len = (con->physical.basedir->used - 1);
if ('/' == con->physical.basedir->ptr[basedir_len-1]) --basedir_len;
uri_len = con->physical.path->used - 1 - basedir_len;
uri_ptr = con->physical.path->ptr + basedir_len;

2
src/response.c

@ -517,8 +517,8 @@ handler_t http_response_prepare(server *srv, connection *con) {
*/
buffer_copy_string_buffer(con->physical.path, con->physical.doc_root);
BUFFER_APPEND_SLASH(con->physical.path);
buffer_copy_string_buffer(con->physical.basedir, con->physical.path);
BUFFER_APPEND_SLASH(con->physical.path);
if (con->physical.rel_path->used &&
con->physical.rel_path->ptr[0] == '/') {
buffer_append_string_len(con->physical.path, con->physical.rel_path->ptr + 1, con->physical.rel_path->used - 2);

Loading…
Cancel
Save