summaryrefslogtreecommitdiffstats
path: root/server/util_script.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* server/util_script.c: reserve one APLOGNO number after r1879253Luca Toscano2020-06-291-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879348 13f79535-47bb-0310-9956-ffa450edef68
* server/util_script.c: tune logging Last-Modified headerLuca Toscano2020-06-271-3/+2
| | | | | | | | | | | Follow up after Joe's feedback in STATUS: - If APR_DATE_BAD is returned for Last-Modified, log it at INFO level (as opposed to trace). - Remove unnecessary guard for APLOGrtrace1(r). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879253 13f79535-47bb-0310-9956-ffa450edef68
* Fix spelling errors found by codespell. [skip ci]Mike Rumph2020-02-131-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1873985 13f79535-47bb-0310-9956-ffa450edef68
* ap_add_common_vars(): use apr_pstrmemdup().Yann Ylavic2017-12-211-3/+2
| | | | | | | This avoids a transient replacement/restore of '?' by '\0' in r->filename. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1818924 13f79535-47bb-0310-9956-ffa450edef68
* * server/util_script.c (ap_add_common_vars): Allow mod_env to overrideJoe Orton2017-10-111-25/+29
| | | | | | | | all system path environment variables, not just PATH. (The behaviour for PATH alone was changed in r965679 for PR 43906.) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1811831 13f79535-47bb-0310-9956-ffa450edef68
* After a long discussion in dev@ I reviewed my previous commit to only warnLuca Toscano2016-08-261-17/+37
| | | | | | | | | | | | | | | | | | | the admins about Last-Modified header violations rather than trying to interpret datestrings (like the ones not in GMT). I also added explicit comments to summarize the current assumptions, so it will be easier for somebody in the future to modify the code. The following use cases are covered: 1) (F)CGI backend sends a Last-Modified header not in GMT and considered in the future by httpd (like now() in the EU/Paris timezone) 2) (F)CGI backend sends a Last-Modified header not in GMT and not considered in the future by httpd (like now() + 2 hours in the PST timezone) 3) (F)CGI backend sends a Last-Modified header in GMT but with a datetime in the future Suggestions and opinion are really welcome. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1757818 13f79535-47bb-0310-9956-ffa450edef68
* Optimization to httpoxy workaround, for 2.4.23+ only.William A. Rowe Jr2016-07-181-1/+1
| | | | | | | Submitted by: ylavic git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1753229 13f79535-47bb-0310-9956-ffa450edef68
* httpoxy workarounds, first draft patch as published for all 2.2.x+ sourcesWilliam A. Rowe Jr2016-07-181-0/+8
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1753228 13f79535-47bb-0310-9956-ffa450edef68
* Improve the FCGI/CGI Last-Modified header value handling.Luca Toscano2016-07-031-20/+17
| | | | | | | | | | | | | | Patch from Yann after a discussion on the dev@ mailing list. ap_scan_script_header_err_core_ex is now using apr_date_parse_rfc in order to recognize non-GMT datestr following RFC822/1123 and transforming them to GMT rather than replacing the value with GMT now (that could add httpd's processing time to the original value). Logging has also been improved from my initial solution. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1751138 13f79535-47bb-0310-9956-ffa450edef68
* Fixed typo in log message, wrong RFC mentioned.Luca Toscano2016-07-011-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1750953 13f79535-47bb-0310-9956-ffa450edef68
* Fix indentation and extra spaces of my previous commit, apologies.Luca Toscano2016-06-301-9/+9
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1750749 13f79535-47bb-0310-9956-ffa450edef68
* Log CGI/FCGI Last-Modified header value changes.Luca Toscano2016-06-301-0/+19
| | | | | | | | | | | | | | | The Last-Modified header coming from a backend FCGI/CGI script is inspected by util_script.c to enforce RFC2616 (https://tools.ietf.org/html/rfc2616#section-14.29). The Last-Modified header also needs to be compliant with RFC882/1123 as stated in https://tools.ietf.org/html/rfc2616#section-3.3.1, and one important assumption that httpd makes (correctly, as the RFC suggests) is to assume the GMT timezone. If the datestr returned by the FCGI/CGI script is set with a different timezone, then the value might be considered "in the future" and replaced with GMT now() as calculated by httpd. Adding a trace log might help sysadmins while debugging these kind of issues. This is a follow up of r1748379. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1750747 13f79535-47bb-0310-9956-ffa450edef68
* Drop an invalid Last-Modified header value returned by a FCGI/CGILuca Toscano2016-06-141-3/+11
| | | | | | | | | | | | | | | | | | | | | | script instead tranforming it to Unix Epoch. This bug was mentioned in the users@ mailing list and outlined in the following centos bug: https://bugs.centos.org/view.php?id=10940 To reproduce the issue it is sufficient to connect mod-fastcgi to a PHP script that returns a HTTP response with the header "Last-Modified: foo". The header will be modified by script_util.c to "Last-Modified: Thu, 01 Jan 1970 00:00:00 GMT". Dropping an invalid header in this case seems to be the most consistent and correct option in my opinion, plus it shouldn't break existing configurations. Returning Unix Epoch might be dangerous and should be avoided, but please let me know your opinions. Moreover this is my first commit outside the documentation court, I hope to have got the procedure right. This fix has been tested also with the 2.4.x branch. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1748379 13f79535-47bb-0310-9956-ffa450edef68
* Rename ap_casecmpstr[n]() to ap_cstr_casecmp[n](), update with APR doxygenWilliam A. Rowe Jr2016-06-091-13/+13
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1747469 13f79535-47bb-0310-9956-ffa450edef68
* Add CGIVar directive for configuring REQUEST_URI behaviorJeff Trawick2016-03-141-1/+14
| | | | | | | | The goal is to use this one directive to handle any configurable CGI variable behavior; only one CGI variable is supported initially. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1734947 13f79535-47bb-0310-9956-ffa450edef68
* hostname: Test and log useragent_host per-request across various modules,William A. Rowe Jr2016-02-121-1/+1
| | | | | | | | | | | | | including the scoreboard, expression and rewrite engines, setenvif, authz_host, access_compat, custom logging, ssl and REMOTE_HOST variables. PR55348 [William Rowe] This is the complete change set which applies cleanly to 2.4.x as well, the server/scoreboard.c will follow, which does not apply due to drift. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1729930 13f79535-47bb-0310-9956-ffa450edef68
* Added many log numbers to log statements thatRainer Jung2016-01-191-0/+4
| | | | | | | | | had none. Those were not detected by the coccinelle script. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725485 13f79535-47bb-0310-9956-ffa450edef68
* Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).Yann Ylavic2015-11-231-13/+13
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715876 13f79535-47bb-0310-9956-ffa450edef68
* Revert r1715789: will re-commit without spurious functional changes.Yann Ylavic2015-11-231-13/+13
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715869 13f79535-47bb-0310-9956-ffa450edef68
* Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).Yann Ylavic2015-11-231-13/+13
| | | | | | | [Reverted by r1715869] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715789 13f79535-47bb-0310-9956-ffa450edef68
* followup to r1710380 -- refactored name and didn't have 'make depend'Eric Covener2015-10-241-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1710391 13f79535-47bb-0310-9956-ffa450edef68
* Make the fix for fully qualifying REDIRECT_URL from PR#57785 opt-in. Eric Covener2015-10-241-13/+18
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1710380 13f79535-47bb-0310-9956-ffa450edef68
* core/util_script: relax alphanumeric filter of enviroment variable namesGregg Lewis Smith2015-09-251-0/+4
| | | | | | | | on Windows to allow '(' and ')' for passing PROGRAMFILES(X86) et.al. unadulterated in 64 bit versions of Windows. PR 46751. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1705217 13f79535-47bb-0310-9956-ffa450edef68
* Make REDIRECT_URL a complete URL (where set).Nick Kew2015-05-051-2/+15
| | | | | | | PR 57785 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1677702 13f79535-47bb-0310-9956-ffa450edef68
* core: Add CGIPassAuth directive to control whether HTTP authorizationJeff Trawick2014-12-021-1/+5
| | | | | | | | | headers are passed to scripts as CGI variables. PR: 56855 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1642847 13f79535-47bb-0310-9956-ffa450edef68
* Turn some APR_BUCKET_REMOVE(e)+apr_bucket_destroy(e) into the equivalent ↵Christophe Jaillet2014-08-011-2/+1
| | | | | | apr_bucket_delete(e) to reduce code verbosity git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1615026 13f79535-47bb-0310-9956-ffa450edef68
* Add missing APLOGNO.Christophe Jaillet2014-07-201-1/+2
| | | | | | | | Refactor some lines to keep APLOGNO on the same line as ap_log_error, when applicable. Split lines longer than 80. Improve alignment. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1612068 13f79535-47bb-0310-9956-ffa450edef68
* Remove useless tests.Christophe Jaillet2013-03-031-1/+1
| | | | | | | | | Turn if (*x && apr_isspace(*x)) into if (apr_isspace(*x)) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1452128 13f79535-47bb-0310-9956-ffa450edef68
* Avoid some memory allocation on error path in 'http2env' if TRACE1 logging ↵Christophe Jaillet2013-03-011-6/+8
| | | | | | | | | 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1451478 13f79535-47bb-0310-9956-ffa450edef68
* remove an unnecessary check in a nest loop of ap_create_environment()Ryan Pan2012-08-281-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1378178 13f79535-47bb-0310-9956-ffa450edef68
* Apply the same length limit when logging Status header valuesChris Darroch2012-08-231-2/+2
| | | | | | | | | as used when logging invalid header lines. Application of a limit on logged header data suggested by Jeff Trawick. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1376695 13f79535-47bb-0310-9956-ffa450edef68
* Log the value of Status header lines in script responses rather thanChris Darroch2012-07-171-2/+2
| | | | | | | than just the fixed header name of "Status". git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1362538 13f79535-47bb-0310-9956-ffa450edef68
* Fix error handling in ap_scan_script_header_err_brigade() if thereStefan Fritsch2012-04-091-3/+4
| | | | | | | | | | | | | 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) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1311174 13f79535-47bb-0310-9956-ffa450edef68
* Make sure the getsfunc_*() functions used by ap_scan_script_header_err*()Stefan Fritsch2012-02-141-1/+4
| | | | | | | | NUL-terminate the resulting string, even in case of an error. mod_cgi and mod_cgid try to log incomplete output from CGI scripts. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1244211 13f79535-47bb-0310-9956-ffa450edef68
* Handle cases, esp when using mod_proxy_fcgi, when we do notJim Jagielski2012-02-091-1/+9
| | | | | | want SCRIPT_FILENAME to include the query string. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1242351 13f79535-47bb-0310-9956-ffa450edef68
* Further clarify the naming of the entity that directly connects to us byGraham Leggett2011-12-141-1/+1
| | | | | | | calling that entity a client instead of a peer. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1214015 13f79535-47bb-0310-9956-ffa450edef68
* Further clarify the naming of the entity that originates the request byGraham Leggett2011-12-141-1/+1
| | | | | | | calling that entity a useragent instead of a client. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1214005 13f79535-47bb-0310-9956-ffa450edef68
* Introduce a per connection "peer_ip" and a per request "client_ip" toGraham Leggett2011-11-251-2/+2
| | | | | | | | distinguish between the raw IP address of the connection and the effective IP address of the request. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1206291 13f79535-47bb-0310-9956-ffa450edef68
* Cleanup effort in prep for GA push:Jim Jagielski2011-09-231-2/+2
| | | | | | | | Trim trailing whitespace... no func change git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
* Make the SERVER_NAME variable include [ ] for literal IPv6 addresses, asStefan Fritsch2011-07-171-1/+1
| | | | | | | | | mandated by RFC 3875 PR: 26005 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1147614 13f79535-47bb-0310-9956-ffa450edef68
* Add more (trace) logging to the ap_scan_script_header*() functionsStefan Fritsch2011-07-161-12/+87
| | | | | | | | | | 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1147493 13f79535-47bb-0310-9956-ffa450edef68
* improve readability of 'malformed header from script' message and simplify codeStefan Fritsch2011-07-161-11/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1147487 13f79535-47bb-0310-9956-ffa450edef68
* Introduce ap_(get|set)_core_module_config() functions/macros and use themStefan Fritsch2011-06-061-1/+3
| | | | | | | | | | | | 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132781 13f79535-47bb-0310-9956-ffa450edef68
* - Introduce concept of context prefix (which is an URL prefix)Stefan Fritsch2011-06-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132494 13f79535-47bb-0310-9956-ffa450edef68
* Make the REQUEST_SCHEME variable available to scripts and mod_rewriteStefan Fritsch2010-12-301-0/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1053872 13f79535-47bb-0310-9956-ffa450edef68
* Log a trace message if we drop a header with an invalid nameStefan Fritsch2010-12-281-3/+6
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1053365 13f79535-47bb-0310-9956-ffa450edef68
* Move duplicated code into utility functionsStefan Fritsch2010-12-281-70/+42
| | | | | | | Submitted by: Malte S. Stretz <mss@apache.org>, Stefan Fritsch git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1053363 13f79535-47bb-0310-9956-ffa450edef68
* When exporting request headers to HTTP_* environment variables, drop variablesStefan Fritsch2010-12-281-4/+7
| | | | | | | | | | whose names contain invalid characters. Describe in the docs how to restore the old behaviour. Submitted by: Malte S. Stretz <mss apache org> git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1053353 13f79535-47bb-0310-9956-ffa450edef68
* Because PATH and the library path are closely interrelated, and the causeWilliam A. Rowe Jr2010-09-231-6/+26
| | | | | | | | | | | | | | | 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1000593 13f79535-47bb-0310-9956-ffa450edef68
* Enable SetEnv to set PATHNick Kew2010-07-201-1/+5
| | | | | | | PR 43906 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@965679 13f79535-47bb-0310-9956-ffa450edef68