Browse Source

[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
personal/stbuehler/mod-csrf-old
Glenn Strauss 6 years ago
parent
commit
a0a7b9fbf5
  1. 2
      src/mod_cml_lua.c
  2. 2
      src/mod_ssi.c

2
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));
}

2
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);

Loading…
Cancel
Save