]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge 1734817, 1734955, r1734989, from trunk:
authorJeff Trawick <trawick@apache.org>
Mon, 21 Mar 2016 12:37:25 +0000 (12:37 +0000)
committerJeff Trawick <trawick@apache.org>
Mon, 21 Mar 2016 12:37:25 +0000 (12:37 +0000)
mod_include now sets DOCUMENT_ARGS.

* Like DOCUMENT_URI, this is for the SSI document, not for any
  subrequest called for the include directive.
* Like QUERY_STRING, this is just r->args (or empty string if there are
  none), unlike QUERY_STRING_UNESCAPED.

The name of the variable is taken from the Zeus SSI implementation.

Follow-up to r1734817: suexec passes through mod_include's DOCUMENT_ARGS

Follow-up to r1734817: Reorder, mention compatibility

Submitted by: trawick
Reviewed by: jim, ylavic

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1735963 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
docs/manual/mod/mod_include.xml
modules/filters/mod_include.c
support/suexec.c

diff --git a/CHANGES b/CHANGES
index b4ad1f5ffcee34233d94050f0975afee03196115..384487beb466987a17171e01000ee7952618c86d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
                                                          -*- coding: utf-8 -*-
 
+  *) mod_include: Add variable DOCUMENT_ARGS, with the arguments to the
+     request for the SSI document.  [Jeff Trawick]
+
   *) mod_authz_host: Add a new "forward-dns" authorization type, not relying on
      reverse DNS lookups.  [Fabien]
 
diff --git a/STATUS b/STATUS
index fc4e3440099628a40ac1014fb60a8d6b671ea04b..1eb6e39d7723ffd07223645e2f5084bfa9daf980 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -112,14 +112,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) DOCUMENT_ARGS, set by mod_include to represent args to SSI document;
-     unlike UNESCAPED_QUERY_STRING, not shell-escaped
-     trunk patch: r1734817, r1734955, r1734989 (but version compat and CHANGES
-                  need to be manipulated)
-     2.4.x patch: https://emptyhammock.com/media/downloads/DOCUMENT_ARGS-to-2.4.x.txt
-     +1: trawick, jim, ylavic
-     ylavic: The second CHANGES entry added in the patch should not be merged...
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index 2fe94d98a191930e769fb21b2d586dd12a9c4e9c..04b57fcd1087fe7b882eca2e37321f8893c06e95 100644 (file)
@@ -526,6 +526,16 @@ AddOutputFilter INCLUDES .shtml
       <dt><code>DATE_LOCAL</code></dt>
       <dd>The current date in the local time zone.</dd>
 
+      <dt><code>DOCUMENT_ARGS</code></dt>
+      <dd>This variable contains the query string of the active SSI
+      document, or the empty string if a query string is not
+      included.  For subrequests invoked through the
+      <code>include</code> SSI directive, <code>QUERY_STRING</code>
+      will represent the query string of the subrequest and
+      <code>DOCUMENT_ARGS</code> will represent the query string of
+      the SSI document.  (Available in Apache HTTP Server 2.4.19 and
+      later.)</dd>
+
       <dt><code>DOCUMENT_NAME</code></dt>
       <dd>The filename (excluding directories) of the document
       requested by the user.</dd>
@@ -544,10 +554,13 @@ AddOutputFilter INCLUDES .shtml
       the user.</dd>
 
       <dt><code>QUERY_STRING_UNESCAPED</code></dt>
-      <dd>If a query string is present, this variable contains the
-      (%-decoded) query string, which is <em>escaped</em> for shell
-      usage (special characters like <code>&amp;</code> etc. are
-      preceded by backslashes).</dd>
+      <dd>If a query string is present in the request for the active
+      SSI document, this variable contains the (%-decoded) query
+      string, which is <em>escaped</em> for shell usage (special
+      characters like <code>&amp;</code> etc. are preceded by
+      backslashes).  It is not set if a query string is not
+      present.  Use <code>DOCUMENT_ARGS</code> if shell escaping
+      is not desired.</dd>
     </dl>
 </section>
 
index bc0204f46c783f5f8ad5ed01e46d9c164bd0b67d..0f3527c0fedb8aa7564dc37997bd15a302104ee0 100644 (file)
@@ -597,6 +597,7 @@ static void add_include_vars(request_rec *r)
     apr_table_setn(e, "DATE_GMT", LAZY_VALUE);
     apr_table_setn(e, "LAST_MODIFIED", LAZY_VALUE);
     apr_table_setn(e, "DOCUMENT_URI", r->uri);
+    apr_table_setn(e, "DOCUMENT_ARGS", r->args ? r->args : "");
     if (r->path_info && *r->path_info) {
         apr_table_setn(e, "DOCUMENT_PATH_INFO", r->path_info);
     }
index 28171253bec65295bc0cffcd6755ccc086248d69..0b2491e28b394985edb6e3db98598f044b985472 100644 (file)
@@ -85,6 +85,7 @@ static const char *const safe_env_lst[] =
     "CONTEXT_PREFIX=",
     "DATE_GMT=",
     "DATE_LOCAL=",
+    "DOCUMENT_ARGS=",
     "DOCUMENT_NAME=",
     "DOCUMENT_PATH_INFO=",
     "DOCUMENT_ROOT=",