maintain physical.basedir (the "acting" doc-root as prefix of physical.path) in more places

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

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2926 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.34
Stefan Bühler 9 years ago
parent c8fbc16985
commit 17762fad01
  1. 1
      NEWS
  2. 3
      src/mod_magnet.c
  3. 1
      src/mod_secure_download.c
  4. 2
      src/mod_userdir.c
  5. 3
      src/response.c

@ -12,6 +12,7 @@ NEWS
* [stat-cache] fix FAM cleanup/fdevent handling
* [core] check success of setuid,setgid,setgroups (CVE-2013-4559)
* [ssl] fix regression from CVE-2013-4508 (client-cert sessions were broken)
* maintain physical.basedir (the "acting" doc-root as prefix of physical.path) in more places
- 1.4.33 - 2013-09-27
* mod_fastcgi: fix mix up of "mode" => "authorizer" in other fastcgi configs (fixes #2465, thx peex)

@ -446,6 +446,7 @@ typedef struct {
MAGNET_ENV_PHYICAL_PATH,
MAGNET_ENV_PHYICAL_REL_PATH,
MAGNET_ENV_PHYICAL_DOC_ROOT,
MAGNET_ENV_PHYICAL_BASEDIR,
MAGNET_ENV_URI_PATH,
MAGNET_ENV_URI_PATH_RAW,
@ -466,6 +467,7 @@ static const magnet_env_t magnet_env[] = {
{ "physical.path", MAGNET_ENV_PHYICAL_PATH },
{ "physical.rel-path", MAGNET_ENV_PHYICAL_REL_PATH },
{ "physical.doc-root", MAGNET_ENV_PHYICAL_DOC_ROOT },
{ "physical.basedir", MAGNET_ENV_PHYICAL_BASEDIR },
{ "uri.path", MAGNET_ENV_URI_PATH },
{ "uri.path-raw", MAGNET_ENV_URI_PATH_RAW },
@ -497,6 +499,7 @@ static buffer *magnet_env_get_buffer_by_id(server *srv, connection *con, int id)
case MAGNET_ENV_PHYICAL_PATH: dest = con->physical.path; break;
case MAGNET_ENV_PHYICAL_REL_PATH: dest = con->physical.rel_path; break;
case MAGNET_ENV_PHYICAL_DOC_ROOT: dest = con->physical.doc_root; break;
case MAGNET_ENV_PHYICAL_BASEDIR: dest = con->physical.basedir; break;
case MAGNET_ENV_URI_PATH: dest = con->uri.path; break;
case MAGNET_ENV_URI_PATH_RAW: dest = con->uri.path_raw; break;

@ -276,6 +276,7 @@ URIHANDLER_FUNC(mod_secdownload_uri_handler) {
*/
buffer_copy_string_buffer(con->physical.doc_root, p->conf.doc_root);
buffer_copy_string_buffer(con->physical.basedir, p->conf.doc_root);
buffer_copy_string(con->physical.rel_path, rel_uri);
buffer_copy_string_buffer(con->physical.path, con->physical.doc_root);
buffer_append_string_buffer(con->physical.path, con->physical.rel_path);

@ -293,6 +293,8 @@ URIHANDLER_FUNC(mod_userdir_docroot_handler) {
}
}
buffer_copy_string_buffer(con->physical.basedir, p->temp_path);
/* the physical rel_path is basically the same as uri.path;
* but it is converted to lowercase in case of force_lowercase_filenames and some special handling
* for trailing '.', ' ' and '/' on windows

@ -516,8 +516,8 @@ handler_t http_response_prepare(server *srv, connection *con) {
*
*/
buffer_copy_string_buffer(con->physical.basedir, con->physical.doc_root);
buffer_copy_string_buffer(con->physical.path, con->physical.doc_root);
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] == '/') {
@ -549,6 +549,7 @@ handler_t http_response_prepare(server *srv, connection *con) {
if (con->conf.log_request_handling) {
log_error_write(srv, __FILE__, __LINE__, "s", "-- logical -> physical");
log_error_write(srv, __FILE__, __LINE__, "sb", "Doc-Root :", con->physical.doc_root);
log_error_write(srv, __FILE__, __LINE__, "sb", "Basedir :", con->physical.basedir);
log_error_write(srv, __FILE__, __LINE__, "sb", "Rel-Path :", con->physical.rel_path);
log_error_write(srv, __FILE__, __LINE__, "sb", "Path :", con->physical.path);
}

Loading…
Cancel
Save