From a0a7b9fbf520be500adf9fbb088dacf9f0444a6f Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Mon, 2 May 2016 14:31:36 -0400 Subject: [PATCH] [mod_ssi, mod_cml] set DOCUMENT_ROOT to basedir (fixes #2383) fixes inconsistency w/ mod_fastcgi, mod_scgi, mod_cgi change in adc97e5b x-ref: "mod_alias: use alias directory as doc-root too" https://redmine.lighttpd.net/issues/2383 "mod_userdir doesn't set environment variable DOCUMENT_ROOT" https://redmine.lighttpd.net/issues/2216 --- src/mod_cml_lua.c | 2 +- src/mod_ssi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod_cml_lua.c b/src/mod_cml_lua.c index 519f9c89..67f989e7 100644 --- a/src/mod_cml_lua.c +++ b/src/mod_cml_lua.c @@ -152,7 +152,7 @@ int cache_parse_lua(server *srv, connection *con, plugin_data *p, buffer *fn) { c_to_lua_push(L, header_tbl, CONST_STR_LEN("REQUEST_URI"), CONST_BUF_LEN(con->request.orig_uri)); c_to_lua_push(L, header_tbl, CONST_STR_LEN("SCRIPT_NAME"), CONST_BUF_LEN(con->uri.path)); c_to_lua_push(L, header_tbl, CONST_STR_LEN("SCRIPT_FILENAME"), CONST_BUF_LEN(con->physical.path)); - c_to_lua_push(L, header_tbl, CONST_STR_LEN("DOCUMENT_ROOT"), CONST_BUF_LEN(con->physical.doc_root)); + c_to_lua_push(L, header_tbl, CONST_STR_LEN("DOCUMENT_ROOT"), CONST_BUF_LEN(con->physical.basedir)); if (!buffer_string_is_empty(con->request.pathinfo)) { c_to_lua_push(L, header_tbl, CONST_STR_LEN("PATH_INFO"), CONST_BUF_LEN(con->request.pathinfo)); } diff --git a/src/mod_ssi.c b/src/mod_ssi.c index 9172fa2c..8d4452a5 100644 --- a/src/mod_ssi.c +++ b/src/mod_ssi.c @@ -283,7 +283,7 @@ static int build_ssi_cgi_vars(server *srv, connection *con, plugin_data *p) { } ssi_env_add(p->ssi_cgi_env, CONST_STRING("SCRIPT_FILENAME"), con->physical.path->ptr); - ssi_env_add(p->ssi_cgi_env, CONST_STRING("DOCUMENT_ROOT"), con->physical.doc_root->ptr); + ssi_env_add(p->ssi_cgi_env, CONST_STRING("DOCUMENT_ROOT"), con->physical.basedir->ptr); ssi_env_add(p->ssi_cgi_env, CONST_STRING("REQUEST_URI"), con->request.uri->ptr);