util_script.c

Checkout Tools
  • last updated 7 hours ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates

Changeset 1677702 is being indexed.

Make REDIRECT_URL a complete URL (where set).

PR 57785

  1. … 1 more file in changeset.
core: Add CGIPassAuth directive to control whether HTTP authorization

headers are passed to scripts as CGI variables.

PR: 56855

  1. … 5 more files in changeset.
Turn some APR_BUCKET_REMOVE(e)+apr_bucket_destroy(e) into the equivalent apr_bucket_delete(e) to reduce code verbosity

  1. … 4 more files in changeset.
Add missing APLOGNO.

Refactor some lines to keep APLOGNO on the same line as ap_log_error, when applicable.

Split lines longer than 80.

Improve alignment.

  1. … 14 more files in changeset.
Remove useless tests.

Turn

if (*x && apr_isspace(*x))

into

if (apr_isspace(*x))

  1. … 9 more files in changeset.
Avoid some memory allocation on error path in 'http2env' if TRACE1 logging is not activated.

Avoid a function call to 'apr_filepath_name_get' which ends up to a strrchr call, if TRACE1 logging is not activated.

remove an unnecessary check in a nest loop of ap_create_environment()

Apply the same length limit when logging Status header values

as used when logging invalid header lines.

Application of a limit on logged header data suggested by Jeff Trawick.

Log the value of Status header lines in script responses rather than

than just the fixed header name of "Status".

  1. … 1 more file in changeset.
Fix error handling in ap_scan_script_header_err_brigade() if there

is no EOS bucket in the brigade:

Also don't loop if there is a timeout when discarding the script output.

Thanks to Edgar Frank for the analysis.

PR: 48272 (partial fix)

  1. … 1 more file in changeset.
Make sure the getsfunc_*() functions used by ap_scan_script_header_err*()

NUL-terminate the resulting string, even in case of an error. mod_cgi

and mod_cgid try to log incomplete output from CGI scripts.

Handle cases, esp when using mod_proxy_fcgi, when we do not

want SCRIPT_FILENAME to include the query string.

  1. … 4 more files in changeset.
Further clarify the naming of the entity that directly connects to us by

calling that entity a client instead of a peer.

  1. … 15 more files in changeset.
Further clarify the naming of the entity that originates the request by

calling that entity a useragent instead of a client.

  1. … 4 more files in changeset.
Introduce a per connection "peer_ip" and a per request "client_ip" to

distinguish between the raw IP address of the connection and the effective

IP address of the request.

  1. … 23 more files in changeset.
Cleanup effort in prep for GA push:

Trim trailing whitespace... no func change

  1. … 118 more files in changeset.
Make the SERVER_NAME variable include [ ] for literal IPv6 addresses, as

mandated by RFC 3875

PR: 26005

  1. … 5 more files in changeset.
Add more (trace) logging to the ap_scan_script_header*() functions

Add ap_scan_script_header*_ex() functions that take a module index for

logging.

Make mod_cgi, mod_cgid, mod_proxy_fcgi, mod_proxy_scgi, mod_isapi use the

new functions.

  1. … 9 more files in changeset.
improve readability of 'malformed header from script' message and simplify code

Introduce ap_(get|set)_core_module_config() functions/macros and use them

everywhere.

We know that the core module has module_index 0. Therefore we can save

some pointer operations in ap_get_module_config(cv, &core_module) and

ap_set_module_config(cv, &core_module, val). As these are called rather often,

this may actually have some (small) measurable effect.

  1. … 42 more files in changeset.
- Introduce concept of context prefix (which is an URL prefix)

and context document root (which is the file system directory that

this URL prefix is mapped to). This generalization of the document

root makes it easier for scripts to create self-referential URLs and

to find their files.

- Expose CONTEXT_DOCUMENT_ROOT and CONTEXT_PREFIX as envvars, in mod_rewrite,

and in ap_expr.

- Make mod_alias and mod_userdir set the context information.

- Allow to override the document root on a per-request basis. This allows

mass vhosting modules to set DOCUMENT_ROOT correctly.

- Make mod_vhost_alias set the per-request document root

PR: 26052, 46198, 49705

Remaining tasks:

- Use the context document root & prefix in mod_rewrite to make RewriteBase

unneccessary in many cases. Do this without breaking compatibility.

- Write docs.

  1. … 10 more files in changeset.
Make the REQUEST_SCHEME variable available to scripts and mod_rewrite

  1. … 4 more files in changeset.
Log a trace message if we drop a header with an invalid name

Move duplicated code into utility functions

Submitted by: Malte S. Stretz <mss@apache.org>, Stefan Fritsch

When exporting request headers to HTTP_* environment variables, drop variables

whose names contain invalid characters. Describe in the docs how to restore the

old behaviour.

Submitted by: Malte S. Stretz <mss apache org>

  1. … 4 more files in changeset.
Because PATH and the library path are closely interrelated, and the cause

of most confusion over cgi or fcgid failures, or even starting rotatelogs,

etc, when the server binaries have been relocated, pass the library path

as paired with the system PATH.

Of course, PATH and platform-specific library path(s) may be modified as

needed with mod_env, so there is no loss of functionality with this change.

The days of monolithic binaries are long gone, even on 1970's architectures,

and PATH should not be decoupled from the library path.

  1. … 1 more file in changeset.
Enable SetEnv to set PATH

PR 43906

  1. … 1 more file in changeset.
Drop ap_body_to_table due to missing constraints; a DoS waiting

for an exploit.

Some mod_lua fan aught to revisit this and provide a sensible

implementation.

  1. … 4 more files in changeset.
Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take

advantage of per-module loglevels

  1. … 169 more files in changeset.
Fix string constness to get rid of gcc compiler warnings by -Wwrite-strings.
  1. … 4 more files in changeset.