From: Jeff Trawick Date: Mon, 21 Mar 2016 12:37:25 +0000 (+0000) Subject: Merge 1734817, 1734955, r1734989, from trunk: X-Git-Tag: 2.4.19~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c97bed356a761b85fed27f51ed9f71cf88a0753;p=thirdparty%2Fapache%2Fhttpd.git Merge 1734817, 1734955, r1734989, from trunk: 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 --- diff --git a/CHANGES b/CHANGES index b4ad1f5ffce..384487beb46 100644 --- 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 fc4e3440099..1eb6e39d772 100644 --- 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 ] diff --git a/docs/manual/mod/mod_include.xml b/docs/manual/mod/mod_include.xml index 2fe94d98a19..04b57fcd108 100644 --- a/docs/manual/mod/mod_include.xml +++ b/docs/manual/mod/mod_include.xml @@ -526,6 +526,16 @@ AddOutputFilter INCLUDES .shtml
DATE_LOCAL
The current date in the local time zone.
+
DOCUMENT_ARGS
+
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 + include SSI directive, QUERY_STRING + will represent the query string of the subrequest and + DOCUMENT_ARGS will represent the query string of + the SSI document. (Available in Apache HTTP Server 2.4.19 and + later.)
+
DOCUMENT_NAME
The filename (excluding directories) of the document requested by the user.
@@ -544,10 +554,13 @@ AddOutputFilter INCLUDES .shtml the user.
QUERY_STRING_UNESCAPED
-
If a query string is present, this variable contains the - (%-decoded) query string, which is escaped for shell - usage (special characters like & etc. are - preceded by backslashes).
+
If a query string is present in the request for the active + SSI document, this variable contains the (%-decoded) query + string, which is escaped for shell usage (special + characters like & etc. are preceded by + backslashes). It is not set if a query string is not + present. Use DOCUMENT_ARGS if shell escaping + is not desired.
diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index bc0204f46c7..0f3527c0fed 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -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); } diff --git a/support/suexec.c b/support/suexec.c index 28171253bec..0b2491e28b3 100644 --- a/support/suexec.c +++ b/support/suexec.c @@ -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=",