MCPcopy Create free account
hub / github.com/apache/httpd / add_ssi_vars

Function add_ssi_vars

modules/generators/mod_cgi.c:292–320  ·  view source on GitHub ↗

This is the special environment used for running the "exec cmd=" * variety of SSI directives. */

Source from the content-addressed store, hash-verified

290 * variety of SSI directives.
291 */
292static void add_ssi_vars(request_rec *r)
293{
294 apr_table_t *e = r->subprocess_env;
295
296 if (r->path_info && r->path_info[0] != '\0') {
297 request_rec *pa_req;
298
299 apr_table_setn(e, "PATH_INFO", ap_escape_shell_cmd(r->pool,
300 r->path_info));
301
302 pa_req = ap_sub_req_lookup_uri(ap_escape_uri(r->pool, r->path_info),
303 r, NULL);
304 if (pa_req->filename) {
305 apr_table_setn(e, "PATH_TRANSLATED",
306 apr_pstrcat(r->pool, pa_req->filename,
307 pa_req->path_info, NULL));
308 }
309 ap_destroy_sub_req(pa_req);
310 }
311
312 if (r->args) {
313 char *arg_copy = apr_pstrdup(r->pool, r->args);
314
315 apr_table_setn(e, "QUERY_STRING", r->args);
316 ap_unescape_url(arg_copy);
317 apr_table_setn(e, "QUERY_STRING_UNESCAPED",
318 ap_escape_shell_cmd(r->pool, arg_copy));
319 }
320}
321
322static void cgi_child_errfn(apr_pool_t *pool, apr_status_t err,
323 const char *description)

Callers 1

include_cmdFunction · 0.70

Calls 4

ap_escape_shell_cmdFunction · 0.85
ap_sub_req_lookup_uriFunction · 0.85
ap_destroy_sub_reqFunction · 0.85
ap_unescape_urlFunction · 0.85

Tested by

no test coverage detected