summaryrefslogtreecommitdiff
path: root/modules/generators
Commit message (Collapse)AuthorAgeFilesLines
* Follow up to r1909429: Fix scope/block syntax.Yann Ylavic2023-05-041-2/+2
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1909606 13f79535-47bb-0310-9956-ffa450edef68
* mod_status: Remove duplicate keys "BusyWorkers" and "IdleWorkers".Rainer Jung2023-04-261-25/+23
| | | | | | | | | | | | | Resolve inconsistency between the previous two occurrences by counting workers in state SERVER_GRACEFUL no longer as busy, but instead in a new counter "GracefulWorkers" (or on HTML view as "workers gracefully restarting"). Also add the graceful counter as a new column to the existing HTML per process table for async MPMs. PR 63300 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1909429 13f79535-47bb-0310-9956-ffa450edef68
* log an error when ap_runtime_dir_relative fails.Giovanni Bechis2023-04-051-1/+4
| | | | | | | spotted by rpluem@ git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908984 13f79535-47bb-0310-9956-ffa450edef68
* Fix a possible NULL pointer dereference of ap_runtime_dir_relative()Giovanni Bechis2023-04-041-0/+2
| | | | | | | | | | | | | | | ap_runtime_dir_relative() will return NULL on failure. However cgid_init() does not check the return value of ap_runtime_dir_relative() and use it directly. Fix this bug by adding a NULL check. Submitted by: Zhou Qingyang <zhou1615@umn.edu> Github: closes #304 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1908972 13f79535-47bb-0310-9956-ffa450edef68
* *) core/mod_ssl/mpm_event: reverting changes to nonblocing SSL handshakesStefan Eissing2022-02-041-9/+6
| | | | | | | | | | to stabilize CI tests again. Previous revision of trunk has been copied to branches/trunk-ssl-handshake-unblocking to make those into a PR where changes can be discussed and tested separately. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897760 13f79535-47bb-0310-9956-ffa450edef68
* mod_cgi[d]: Close the connection after handling nph- scripts.Yann Ylavic2022-01-281-0/+3
| | | | | | | | | | | | | | | | The HTTP output filters chain is bypassed for nph- scripts (whatever this means), so there is no way to know whether the connection is reusable after sending the cgi response (opaque header + body). Set r->connection->keepalive = AP_CONN_CLOSE unconditionally. For instance test frameork's "nph-foldhdr.pl" script responds with HTTP/1.0 and no Content-Length so closing the connection is the only way to detect the end of response for the peer. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897563 13f79535-47bb-0310-9956-ffa450edef68
* event: Add support for non blocking behaviour in theGraham Leggett2022-01-211-6/+9
| | | | | | | | | CONN_STATE_READ_REQUEST_LINE phase, in addition to the existing CONN_STATE_WRITE_COMPLETION phase. Update mod_ssl to perform non blocking TLS handshakes. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1897281 13f79535-47bb-0310-9956-ffa450edef68
* add IndexForbiddenReturn404 to help silence scannersEric Covener2021-10-211-1/+7
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894455 13f79535-47bb-0310-9956-ffa450edef68
* mod_info: Output AP_MPMQ_MAX_DAEMONS instead of AP_MPMQ_MAX_DAEMON_USED.Yann Ylavic2021-10-131-1/+1
| | | | | | | | The latter is maintained in the parent process only (for maintenance) and is meaningless in the child process (by design). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1894195 13f79535-47bb-0310-9956-ffa450edef68
* * modules/generators/mod_cgid.c (cgid_server): Register cleanup forJoe Orton2021-03-161-3/+3
| | | | | | | | socket earlier to avoid possible leaks on error paths. (highlighted by Coverity scan) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1887727 13f79535-47bb-0310-9956-ffa450edef68
* Enable mod_cgid stderr handling via Unix socket fd transfer byJoe Orton2021-02-252-16/+5
| | | | | | | | | | | | | | | | | | | | | | | default, rather than as an opt-in configure flag. (This has been tested in Fedora for >12 months without seeing any new problems) * configure.in: Check for CMSG_DATA here, and define HAVE_FDPASSING and $ap_has_fdpassing if fd passing is supported. * modules/generator/config5.m4, modules/generator/mod_cgid.c: Drop configure flag for mod_cgid fdpassing support, instead enable where possible by default. * modules/proxy/config.m4: Rely on configure test for CMSG_DATA. * .travis.yml: Switch test for cgid fdpassing for testing w/o CMSG_DATA. Github: closes #172 PR: 54221 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1886912 13f79535-47bb-0310-9956-ffa450edef68
* Fix a compilation error in maintainer mode and be consistent with ↵Christophe Jaillet2020-10-041-1/+1
| | | | | | 'make_autoindex_entry()' git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1882232 13f79535-47bb-0310-9956-ffa450edef68
* Save a few bytes of memory in mod_autoindexChristophe Jaillet2020-10-041-4/+6
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1882231 13f79535-47bb-0310-9956-ffa450edef68
* Further re-unification of code duplicated across mod_cgi/mod_cgid intoJoe Orton2020-09-083-362/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | cgi_common.h. Functional changes: - brings the PR 61980 fix to mod_cgid as well, and - some mod_cgid-specific APLOGNOs are dropped in favour of the code used in the equivalent error path in mod_cgi ... otherwise no user-visible changes (intended). * modules/generators/cgi_common.h (log_scripterror, log_script_err): Move here from mod_cgi. (cgi_handle_exec): Move here, renamed from mod_cgi's handle_exec. (cgi_optfns_retrieve): New function, split out from mod_cgi's cgi_post_config. * modules/generators/mod_cgid.c: Adjust accordingly, update to pass logno separately. (register_hooks): Register cgi_optfns_retrieve. * modules/generators/mod_cgi.c: Adjust accordingly. (register_hooks): Register cgi_optfns_retrieve. Github: closes #141 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1881559 13f79535-47bb-0310-9956-ffa450edef68
* * modules/generators/cgi_common.h (cgi_handle_response): Avoid tryingJoe Orton2020-09-041-0/+7
| | | | | | | | | to read the output brigade twice in the case of a timeout. PR: 64709 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1881459 13f79535-47bb-0310-9956-ffa450edef68
* This not a hot path in RL use case, but looks to be one during testing with ↵Christophe Jaillet2020-08-011-1/+1
| | | | | | | | the test framework. Sso save a few cycles in this (unusual) use case. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1880509 13f79535-47bb-0310-9956-ffa450edef68
* * modules/generators/mod_cgid.c (get_cgi_pid): Fix test for pid=0.Joe Orton2020-07-141-4/+4
| | | | | | | | (cgid_handler): Remove duplicated test for pid=0 here added in r1879119. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879860 13f79535-47bb-0310-9956-ffa450edef68
* * modules/generators/mod_cgid.c (get_req): Add basic sanityJoe Orton2020-06-241-0/+8
| | | | | | | checking for the structure received in the CGI daemon. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879136 13f79535-47bb-0310-9956-ffa450edef68
* * modules/generators/mod_cgid.c (cgid_handler): Bail immediately withJoe Orton2020-06-231-6/+8
| | | | | | | | a 503 response on errors when talking to the daemon. Check the pid returned is not zero. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879119 13f79535-47bb-0310-9956-ffa450edef68
* Declare pre_translate hook in lua/info/log_debug/example modules, and docs.Yann Ylavic2020-06-221-0/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879077 13f79535-47bb-0310-9956-ffa450edef68
* Add ap_normalize_path() to replace ap_getparents() (with options).Yann Ylavic2020-06-221-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | include/httpd.h: Declare ap_normalize_path() and flags. AP_NORMALIZE_ALLOW_RELATIVE: Don't require that the path be absolute as per RFC 7230. This is needed for lookup subrequests. AP_NORMALIZE_NOT_ABOVE_ROOT: Check that directory traversal ("..") don't go above root, or initial directory with relative paths. AP_NORMALIZE_DECODE_UNRESERVED: Decode unreserved characters (like '.') first since they have the same semantics encoded and decoded. AP_NORMALIZE_MERGE_SLASHES: Merge multiple slahes into a single one. AP_NORMALIZE_DROP_PARAMETERS: Ignore path parameters (";foo=bar"). Not used by httpd but since ap_normalize_path() is taken from mod_jk's jk_servlet_normalize() it can allow them to use the upstream version now. server/util.c: Implement ap_normalize_path(). modules/dav/main/util.c: Replace call to ap_getparents() using ap_normalize_path() with AP_NORMALIZE_DECODE_UNRESERVED flag since the path comes from an obsolute URL (thus potentially %-encoded). modules/generators/mod_autoindex.c: Replace call to ap_getparents() using ap_normalize_path() with AP_NORMALIZE_ALLOW_RELATIVE and AP_NORMALIZE_NOT_ABOVE_ROOT flags to be consistent with original code. include/ap_mmn.h: MINOR bump for ap_normalize_path(). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1879074 13f79535-47bb-0310-9956-ffa450edef68
* Add missing pool tags to help debugging.Yann Ylavic2020-04-162-0/+3
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1876599 13f79535-47bb-0310-9956-ffa450edef68
* * modules/generators/cgi_common.h (cgi_handle_request): CatchJoe Orton2020-02-251-1/+4
| | | | | | | (unlikely) apr_bucket_read() failure when reading request. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874511 13f79535-47bb-0310-9956-ffa450edef68
* * modules/generators/cgi_common.h (cgi_handle_request): Factor outJoe Orton2020-02-253-158/+115
| | | | | | | | | | | | | near-identical common code from mod_cgid, mod_cgi. * modules/generators/mod_cgid.c (cgid_handler), modules/generators/mod_cgi.c (cgi_handler): Adjust to use cgi_handle_request. Github: closes #97 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1874491 13f79535-47bb-0310-9956-ffa450edef68
* PR62989: DOCTYPE tags in server-generated HTML. Eric Covener2020-01-312-2/+2
| | | | | | | | | Submitted By: Andra Farkas <deepbluemistake gmail.com>, Giovanni Bechis <giovanni paclan.it> git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1873397 13f79535-47bb-0310-9956-ffa450edef68
* Add comment, no functional change.Joe Orton2019-11-051-0/+4
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1869421 13f79535-47bb-0310-9956-ffa450edef68
* Fix build broken w/o --enable-cgid-fdpassing by r1867968:Joe Orton2019-10-043-3/+8
| | | | | | | | | | | | | | * modules/generators/cgi_common.h: Only define CGI bucket type if WANT_CGI_BUCKET is defined. * modules/generators/mod_cgi.c: Always include cgi_common.h, defining WANT_CGI_BUCKET iff APR_FILES_AS_SOCKETS is defined * modules/generators/mod_cgid.c: Always include cgi_common.h, defining WANT_CGI_BUCKET iff HAVE_CGID_FDPASSING (--enable-cgid-fdpassing). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1867971 13f79535-47bb-0310-9956-ffa450edef68
* * modules/generators/cgi_common.h (discard_script_output): SimplifyJoe Orton2019-10-041-8/+4
| | | | | | | | | slightly and ensure constant rather than unlimited memory consumption when discarding CGI script output (for e.g. a redirect response). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1867970 13f79535-47bb-0310-9956-ffa450edef68
* Move common (and near-identical) code for CGI response output handlingJoe Orton2019-10-043-258/+143
| | | | | | | | | | | | | | | | | | | | | | to cgi_common.h; the diff between the modules for this code was as follows: https://people.apache.org/~jorton/mod_cgi-to-cgid-handler.diff Change from previous: mod_cgi will now explicitly discard output when returning HTTP_MOVED_TEMPORARILY for relative redirects (should not be functionally different), TRACE1 logging of ap_pass_brigade failures for mod_cgid is dropped. * modules/generators/cgi_common.h (cgi_handle_response): New function, factored out from mod_cgid. (discard_script_output): Copied function from mod_cgi/d unchanged. * modules/generator/mod_cgid.c (cgid_handler), modules/generator/mod_cgi.c (cgi_handler): Use cgi_handle_response. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1867968 13f79535-47bb-0310-9956-ffa450edef68
* * modules/generators/cgi_common.h (cgi_bucket_create):Joe Orton2019-10-022-3/+4
| | | | | | | | | | | Disable APR timeout handling here for all callers. * modules/generators/mod_cgi.c (cgi_handler): ... drop it here. PR: 63797 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1867882 13f79535-47bb-0310-9956-ffa450edef68
* * modules/generators/mod_cgid.c (sock_readhdr): Only set up controlJoe Orton2019-10-021-7/+15
| | | | | | | message block when required; add some additional error handling. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1867878 13f79535-47bb-0310-9956-ffa450edef68
* mod_cgid: Continuation of r1862968, experimental fd passing support.Joe Orton2019-07-173-225/+332
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Split out CGI bucket implementation from mod_cgi and use in both mod_cgi and mod_cgid, bringing stderr handling in mod_cgid up to par with mod_cgi. (There is a lot of code which has been copied between mod_cgi{,d} so there's scope for further reduction of source duplication between the modules using this header) * modules/generators/cgi_common.h: Copied from mod_cgi.c, removed everything but the CGI bucket implementation with only one change: (struct cgi_bucket_data, cgi_bucket_create, cgi_bucket_read): Take a timeout on bucket creation, store and use on reads. * modules/generators/mod_cgi.c [APR_FILES_AS_SOCKETS]: Include cgi_common.h. (cgi_handler): Pass configured timeout to CGI bucket. * modules/generators/mod_cgid.c: Include cgi_common.h. (log_script_err): Copy from mod_cgi.c. (log_script): Use log_script_err. (send_req): Take fd for stderr. (cgid_child_errfn): Handle fd-passing case by writing error to stderr for client to pass through ap_log_rerror. (cgid_handler): Create pipe for stderr, pass write-end to server via send_req, use read-end to create CGI bucket. Handle stderr output in failure paths. PR: 54221 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1863191 13f79535-47bb-0310-9956-ffa450edef68
* Add experimental support for fd passing in mod_cgid. Attaches CGIJoe Orton2019-07-122-13/+117
| | | | | | | | | | | | | | | | | | | | script stderr to the error log specific to the vhost, by passing the appropriate fd over the AF_UNIX socket from the request handling thread to the cgid server process. * modules/generators/config5.m4: Add --enable-cgid-fdpassing. * modules/generators/mod_cgid.c (sock_readhdr): New function, also returns auxiliary control data (the stderr fd) if available. (sock_write): Take optional aux fd argument, send it as control data. (send_req, get_req): Adjust accordingly to pass/receive the stderr fd. (cgid_server): Use passed fd if available, limit the lifetime. PR: 60692 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1862968 13f79535-47bb-0310-9956-ffa450edef68
* Fix wrong use of ap_rputs with formats.Rainer Jung2019-04-141-1/+1
| | | | | | | | Use ap_rprintf instead. It seems noone has PIPE_BUF defined. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1857515 13f79535-47bb-0310-9956-ffa450edef68
* Use APR apr_time_as_msec() macro for conversionRainer Jung2018-08-311-10/+9
| | | | | | | | from apr_time_t to milliseconds instead of hard-coded division by 1000. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1839780 13f79535-47bb-0310-9956-ffa450edef68
* mod_status: Cumulate CPU time of exited childRainer Jung2018-08-071-14/+30
| | | | | | | | | processes in the "cu" and "cs" values. Add CPU time of the parent process to the "c" and "s" values. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1837595 13f79535-47bb-0310-9956-ffa450edef68
* mod_status: Add cumulated response duration timeRainer Jung2018-08-071-11/+25
| | | | | | | in milliseconds. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1837590 13f79535-47bb-0310-9956-ffa450edef68
* mod_status: Complete the data shown for asyncRainer Jung2018-08-071-5/+13
| | | | | | | | | MPMs in "auto" mode. Added number of processes, number of stopping processes and number of busy and idle workers. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1837589 13f79535-47bb-0310-9956-ffa450edef68
* Fix PR54848 in a 2.4.x backportable format. Ideally deprecating the useJim Jagielski2018-08-011-2/+2
| | | | | | | | of ->client in whatever version of 2.4 this is added into would be more logical. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1837225 13f79535-47bb-0310-9956-ffa450edef68
* * modules/generators/mod_info.c: Constify fixed tables and markJoe Orton2018-04-111-6/+6
| | | | | | | module-private global variables static. No functional change. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1828909 13f79535-47bb-0310-9956-ffa450edef68
* PR62229: add CGIScriptTimeout to mod_cgiEric Covener2018-04-021-8/+40
| | | | | | | | | | | | | | | add CGIScriptTimeout to mod_cgi, like mod_cgid's CGIDScriptTimeout. Not addressed: making CGIScriptTimeout name work for either module. Submitted By: Hank Ibell <hwibell gmail.com> Committed By: covener git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1828172 13f79535-47bb-0310-9956-ffa450edef68
* PR 61980: AH01215 CGI stderr forwarding msg improvementEric Covener2018-01-101-3/+8
| | | | | | | | | | | | | | *) mod_cgi: Improve AH01215 messages to make it more clear that the message is the CGI scripts stderr output. PR 61980. [Hank Ibell <hwibell gmail.com>] Submitted By: Hank Ibell <hwibell gmail.com> Commited By: covener git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1820716 13f79535-47bb-0310-9956-ffa450edef68
* Follow up to r1740928: including NOT_IN_PROXY in NOT_IN_DIR_LOC_FILE is bothYann Ylavic2017-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | incomplete and not backportable, fix it by introducing NOT_IN_DIR_CONTEXT and restoring NOT_IN_DIR_LOC_FILE to its previous value. Per ap_check_cmd_context(), NOT_IN_DIR_LOC_FILE actually/really means "not in any directory context", while the definition itself does not include all the existing directory contexts (e.g. <Limit>, or <Proxy> before r1740928). This is a bit of a misnomer, at least, so instead of (ab)using it by adding the missing contexts (in an incompatible way), let's define NOT_IN_DIR_CONTEXT to really exclude all directory context (i.e. NOT_IN_DIR_LOC_FILE + NOT_IN_LIMIT + NOT_IN_PROXY) and use it wherever NOT_IN_DIR_LOC_FILE was used. This is by itself a major MMN bump (modules not compiled with this commit and having directives checked against NOT_IN_DIR_LOC_FILE won't be caught the same way by NOT_IN_DIR_CONTEXT in the new ap_check_cmd_context() code), but with the below change, 2.4.x should work as before: - if ((forbidden & NOT_IN_DIR_CONTEXT) == NOT_IN_DIR_CONTEXT) { + if ((forbidden & NOT_IN_DIR_LOC_FILE) == NOT_IN_DIR_LOC_FILE) { if (cmd->path != NULL) { return apr_pstrcat(cmd->pool, cmd->cmd->name, gt, - " cannot occur within directory context", NULL); + " cannot occur within <Directory/Location/Files/Proxy> " + "section", NULL); } ... } git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1812193 13f79535-47bb-0310-9956-ffa450edef68
* httpdunit: merge to trunk from feature branchJacob Champion2017-06-201-1/+1
|\ | | | | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1799378 13f79535-47bb-0310-9956-ffa450edef68
| * configure: don't overwrite other_targets when mod_suexec is enabledJacob Champion2017-05-251-1/+1
| | | | | | | | | | | | Just append to the list. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/httpdunit@1796201 13f79535-47bb-0310-9956-ffa450edef68
* | remove r1792169 taint checks from proxy and status modulesEric Covener2017-05-261-7/+0
|/ | | | | | | | | | | | | Both of these checks are problematic without further work. status: even a .htaccess with no SetHandler blocks the handler. proxy: RewriteRule ... ... [P] in htaccess is blocked. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1796352 13f79535-47bb-0310-9956-ffa450edef68
* Introduce request taint-checking concept.Nick Kew2017-04-211-0/+7
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1792169 13f79535-47bb-0310-9956-ffa450edef68
* no strncasecmp because flag has no valueEric Covener2017-03-241-1/+1
| | | | git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1788451 13f79535-47bb-0310-9956-ffa450edef68
* Use 'ap_cstr_casecmp' to simplify code.Christophe Jaillet2017-03-211-7/+4
| | | | | | Remove useless case. We know that to can not be NULL at this point. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1788033 13f79535-47bb-0310-9956-ffa450edef68
* Save a few bytes in the conf pool.Christophe Jaillet2017-03-211-4/+4
| | | | | | 'push_item' and 'add_alt' already duplicate their parameters, so we can safely use the temp_pool here. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1788032 13f79535-47bb-0310-9956-ffa450edef68