]> TLD Linux GIT Repositories - packages/lighttpd.git/blob - env-documentroot.patch
- updated to 1.4.40, partial PLD merge
[packages/lighttpd.git] / env-documentroot.patch
1 revert:
2
3 -  * [*cgi] Use physical base dir (alias, userdir) as DOCUMENT_ROOT in cgi environments (fixes #2216)
4  
5 --- lighttpd-1.4.36/src/mod_fastcgi.c~  2015-07-26 18:30:29.000000000 +0300
6 +++ lighttpd-1.4.36/src/mod_fastcgi.c   2015-07-26 18:31:50.285226477 +0300
7 @@ -1918,7 +1918,7 @@
8                         if (!buffer_string_is_empty(host->docroot)) {
9                                 buffer_copy_buffer(p->path, host->docroot);
10                         } else {
11 -                               buffer_copy_buffer(p->path, con->physical.basedir);
12 +                               buffer_copy_buffer(p->path, con->physical.doc_root);
13                         }
14                         buffer_append_string_buffer(p->path, con->request.pathinfo);
15                         FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("PATH_TRANSLATED"), CONST_BUF_LEN(p->path)),con)
16 @@ -2008,7 +2008,7 @@
17                 }
18  
19                 FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("SCRIPT_FILENAME"), CONST_BUF_LEN(p->path)),con)
20 -               FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("DOCUMENT_ROOT"), CONST_BUF_LEN(con->physical.basedir)),con)
21 +               FCGI_ENV_ADD_CHECK(fcgi_env_add(p->fcgi_env, CONST_STR_LEN("DOCUMENT_ROOT"), CONST_BUF_LEN(con->physical.doc_root)),con)
22         }
23  
24         if (host->strip_request_uri->used > 1) {
25 @@ -3108,7 +3108,6 @@
26                                  */
27  
28                                 buffer_copy_buffer(con->physical.doc_root, host->docroot);
29 -                               buffer_copy_buffer(con->physical.basedir, host->docroot);
30  
31                                 buffer_copy_buffer(con->physical.path, host->docroot);
32                                 buffer_append_string_buffer(con->physical.path, con->uri.path);
33 --- lighttpd-1.4.36/src/mod_scgi.c~     2015-07-26 18:30:29.000000000 +0300
34 +++ lighttpd-1.4.36/src/mod_scgi.c      2015-07-26 18:33:12.406160926 +0300
35 @@ -1547,7 +1547,7 @@
36                 if (!buffer_string_is_empty(host->docroot)) {
37                         buffer_copy_buffer(p->path, host->docroot);
38                 } else {
39 -                       buffer_copy_buffer(p->path, con->physical.basedir);
40 +                       buffer_copy_buffer(p->path, con->physical.doc_root);
41                 }
42                 buffer_append_string_buffer(p->path, con->request.pathinfo);
43                 scgi_env_add(p->scgi_env, CONST_STR_LEN("PATH_TRANSLATED"), CONST_BUF_LEN(p->path));
44 @@ -1589,7 +1589,7 @@
45                 buffer_copy_string_buffer(p->path, con->physical.path);
46  
47                 scgi_env_add(p->scgi_env, CONST_STR_LEN("SCRIPT_FILENAME"), CONST_BUF_LEN(p->path));
48 -               scgi_env_add(p->scgi_env, CONST_STR_LEN("DOCUMENT_ROOT"), CONST_BUF_LEN(con->physical.basedir));
49 +               scgi_env_add(p->scgi_env, CONST_STR_LEN("DOCUMENT_ROOT"), CONST_BUF_LEN(con->physical.doc_root));
50         }
51         scgi_env_add(p->scgi_env, CONST_STR_LEN("REQUEST_URI"), CONST_BUF_LEN(con->request.orig_uri));
52         if (!buffer_is_equal(con->request.uri, con->request.orig_uri)) {
53 Index: src/mod_cgi.c
54 ===================================================================
55 --- ./src/mod_cgi.c     (revision 2794)
56 +++ ./src/mod_cgi.c     (revision 2793)
57 @@ -928,7 +928,7 @@
58                 cgi_env_add(&env, CONST_STR_LEN("CONTENT_LENGTH"), buf, strlen(buf));
59                 cgi_env_add(&env, CONST_STR_LEN("SCRIPT_FILENAME"), CONST_BUF_LEN(con->physical.path));
60                 cgi_env_add(&env, CONST_STR_LEN("SCRIPT_NAME"), CONST_BUF_LEN(con->uri.path));
61 -               cgi_env_add(&env, CONST_STR_LEN("DOCUMENT_ROOT"), CONST_BUF_LEN(con->physical.basedir));
62 +               cgi_env_add(&env, CONST_STR_LEN("DOCUMENT_ROOT"), CONST_BUF_LEN(con->physical.doc_root));
63  
64                 /* for valgrind */
65                 if (NULL != (s = getenv("LD_PRELOAD"))) {