1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-05 16:55:50 +03:00

224 Commits

Author SHA1 Message Date
Ruediger Pluem
aa4b05ee05 * Always trust content types that we set literally
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1918814 13f79535-47bb-0310-9956-ffa450edef68
2024-07-02 06:35:53 +00:00
Joe Orton
c14406763c * modules/generators/mod_cgi.c, mod_cgid.c: Since
r1916769 adds #include <util_script.h> to cgi_common.h,
  remove it here.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1916998 13f79535-47bb-0310-9956-ffa450edef68
2024-04-15 09:49:56 +00:00
Joe Orton
eabfcda175 Further re-unification of code duplicated across mod_cgi/mod_cgid into
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
2020-09-08 14:08:22 +00:00
Joe Orton
82b87850ee * modules/generators/cgi_common.h (cgi_handle_request): Factor out
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
2020-02-25 12:34:00 +00:00
Joe Orton
f0abf76803 Fix build broken w/o --enable-cgid-fdpassing by r1867968:
* 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
2019-10-04 09:56:42 +00:00
Joe Orton
54c71d419a Move common (and near-identical) code for CGI response output handling
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
2019-10-04 09:20:33 +00:00
Joe Orton
58b69a442e * modules/generators/cgi_common.h (cgi_bucket_create):
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
2019-10-02 10:41:22 +00:00
Joe Orton
eda8ddfc71 mod_cgid: Continuation of r1862968, experimental fd passing support.
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
2019-07-17 07:51:53 +00:00
Eric Covener
d7e880f420 PR62229: add CGIScriptTimeout to mod_cgi
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
2018-04-02 15:22:56 +00:00
Eric Covener
938a1ff0ec PR 61980: AH01215 CGI stderr forwarding msg improvement
*) 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
2018-01-10 00:57:22 +00:00
Yann Ylavic
019efb6465 Follow up to r1739201.
These APR_TIMEUP special cases are now handled by ap_map_http_request_error().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1766998 13f79535-47bb-0310-9956-ffa450edef68
2016-10-28 10:56:03 +00:00
Luca Toscano
4eb7f3d264 mod_cgi/mod_cgid documentation about environment variables added (like DOCUMENT_ROOT).
Bug: 58305



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1726506 13f79535-47bb-0310-9956-ffa450edef68
2016-01-24 16:39:30 +00:00
Rainer Jung
af14d158a3 Added many log numbers to log statements that
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
2016-01-19 12:02:41 +00:00
Yann Ylavic
4bfe0a6bba Follow up to r1715880: revert more abusive ap_casecmpstr[n]() usages.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1722150 13f79535-47bb-0310-9956-ffa450edef68
2015-12-29 15:32:27 +00:00
Yann Ylavic
c80e6b2a34 Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715876 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 16:46:01 +00:00
Yann Ylavic
3c9ddf44bf Revert r1715789: will re-commit without spurious functional changes.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715869 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 16:28:36 +00:00
Yann Ylavic
29843dc73f Use new ap_casecmpstr[n]() functions where appropriate (not exhaustive).
[Reverted by r1715869]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1715789 13f79535-47bb-0310-9956-ffa450edef68
2015-11-23 12:33:09 +00:00
Yann Ylavic
0a431ef862 core, modules: like r1657897 but for core and other modules than mod_proxy.
More uses of ap_map_http_request_error() and AP_FILTER_ERROR so that we never
return an HTTP error status from a handler if some filter generated a response
already.

That is, from a handler, either ap_get_brigade() (an input filter) returned
AP_FILTER_ERROR and we must forward it to ap_die(), or ap_pass_brigade() (an
output filter) failed with any status and we must return AP_FILTER_ERROR in
any case for ap_die() to determine whether a response is needed or not.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1665625 13f79535-47bb-0310-9956-ffa450edef68
2015-03-10 17:25:17 +00:00
Jan Kaluža
84d85f62bb mod_cgi: log cgi script stderr to ScriptLog, use APLOGNO for log_scripterror
errors.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1626978 13f79535-47bb-0310-9956-ffa450edef68
2014-09-23 11:14:09 +00:00
Yann Ylavic
9614c0b8e6 Strip useless apr_brigade_cleanup() calls.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601624 13f79535-47bb-0310-9956-ffa450edef68
2014-06-10 12:44:15 +00:00
Graham Leggett
9bc9d79079 core: Stop the HTTP_IN filter from attempting to write error buckets
to the output filters, which is bogus in the proxy case. Create a
clean mapping from APR codes to HTTP status codes, and use it where
needed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1482522 13f79535-47bb-0310-9956-ffa450edef68
2013-05-14 18:58:06 +00:00
Stefan Fritsch
e00688ffd9 Use %pm available since apr 1.3 instead of an extra call to apr_strerror
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1463056 13f79535-47bb-0310-9956-ffa450edef68
2013-03-31 21:29:28 +00:00
Christophe Jaillet
e4a8666bfa Replace an incorrect #if by the correct corresponding #if defined(...)
PR 54133 reported by Teodor Milkov ()

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1407965 13f79535-47bb-0310-9956-ffa450edef68
2012-11-11 12:53:11 +00:00
Stefan Fritsch
8ec0c56b02 Code clean up (remove useless memory allocation)
Submitted by: Christophe JAILLET <christophe jaillet wanadoo fr>
PR: 52648


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1361803 13f79535-47bb-0310-9956-ffa450edef68
2012-07-15 21:19:54 +00:00
Stefan Fritsch
92e366007c Add lots of unique tags to error log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 23:02:04 +00:00
Stefan Fritsch
b4ec041ba7 Remove more log message prefixes that are now redundant as the
the error log format includes the module name.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1208110 13f79535-47bb-0310-9956-ffa450edef68
2011-11-29 22:28:21 +00:00
Stefan Fritsch
1951a037bf More cleanup: Expand tabs and some more indentation fixes
No functional change


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174929 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 18:08:42 +00:00
Jim Jagielski
427c85bd23 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:39:32 +00:00
Eric Covener
f08932bf97 PR51371: cross-compile issues with cgi and apr_procattr_limit_*.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1172019 13f79535-47bb-0310-9956-ffa450edef68
2011-09-17 17:01:15 +00:00
Stefan Fritsch
beb3ea9c11 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1147493 13f79535-47bb-0310-9956-ffa450edef68
2011-07-16 21:53:18 +00:00
Stefan Fritsch
c9fd2623da 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.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132781 13f79535-47bb-0310-9956-ffa450edef68
2011-06-06 21:26:56 +00:00
Igor Galić
d5024cd27c In comments: s@ XX @ XXX: @ so they can actually be found seen.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1053668 13f79535-47bb-0310-9956-ffa450edef68
2010-12-29 16:25:12 +00:00
Graham Leggett
e206531458 Avoid unnecessariy initialisation before we test mod_cgi's handler name.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1024460 13f79535-47bb-0310-9956-ffa450edef68
2010-10-19 23:07:25 +00:00
Jeff Trawick
0ce133f8a8 Intel's compiler warns about assigning the non-enum value 0 to the
enumeration apr_finfo_t.filetype, which is done when forgetting
the previously-derived file type

use the appropriate enum value APR_NOFILE instead

Also change comparisons of the field with 0 to use APR_NOFILE instead,
as is the practice of some existing code.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@983065 13f79535-47bb-0310-9956-ffa450edef68
2010-08-06 17:36:52 +00:00
Stefan Fritsch
ebb62867fb Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
advantage of per-module loglevels


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951895 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:59:50 +00:00
Stefan Fritsch
2c4ea84eb8 fix potential file descriptor leak with DEBUG_CGI
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@930955 13f79535-47bb-0310-9956-ffa450edef68
2010-04-05 20:36:23 +00:00
Brian Havard
60fbe11de1 Bring back OS/2 support.
Reverses r758929 with a little bit of conflict resolution.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@807930 13f79535-47bb-0310-9956-ffa450edef68
2009-08-26 08:56:13 +00:00
Ruediger Pluem
3fadc493c9 * Do better checking of pollset operations in various places to avoid segfaults.
PR: 46467
Submitted by: Stefan Fritsch <sf sfritsch.de>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@804764 13f79535-47bb-0310-9956-ffa450edef68
2009-08-16 20:29:47 +00:00
Jeff Trawick
ee32468a33 remove OS/2 platform support
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758929 13f79535-47bb-0310-9956-ffa450edef68
2009-03-26 23:47:52 +00:00
Paul Querna
a324a1d72f Remove all references to CORE_PRIVATE.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645455 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 10:45:43 +00:00
Ruediger Pluem
5ebab647ff * Prevent running through the error stack by returning OK and setting r->status
accordingly if ret is HTTP_NOT_MODIFIED as this breaks mod_cache validating a
  stale entity.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@541990 13f79535-47bb-0310-9956-ffa450edef68
2007-05-27 13:57:46 +00:00
Nick Kew
d09a836fb0 PR#39710 - badly broken errordocuments for CGI
We've just had another duplicate report of this on bugzilla.
We've got a simple patch, and people asking WTF is going on
with inaction.  Noone seems clear on why the patch shouldn't
be applied (http://marc.info/?l=apache-httpd-dev&m=117760311129386&w=2).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@541926 13f79535-47bb-0310-9956-ffa450edef68
2007-05-26 18:50:18 +00:00
Garrett Rooney
d20ce0c6a1 Follow up to r451006, use APR_STATUS_IS_TIMEUP instead of comparing against
APR_TIMEUP directly.

Reported by: jorton

* modules/generators/mod_cgi.c
  (cgi_handler): Use APR_STATUS_IS_TIMEUP.

* modules/generators/mod_cgid.c
  (cgid_handler): Ditto.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@451289 13f79535-47bb-0310-9956-ffa450edef68
2006-09-29 13:48:09 +00:00
Ruediger Pluem
faacd788d1 * Notice that reading of the request entity body failed due to a timeout
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@451006 13f79535-47bb-0310-9956-ffa450edef68
2006-09-28 20:15:42 +00:00
Nick Kew
8c2b72b53c PR 31759 (mutated) - reported by Jo Rhett
Don't return apr_status_t error value from input filter chain.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@442758 13f79535-47bb-0310-9956-ffa450edef68
2006-09-12 23:44:12 +00:00
Roy T. Fielding
de659cbed0 update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
Colm MacCarthaigh
dd95d7c37c Update the copyright year in all .c, .h and .xml files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
Jim Jagielski
5061d9fa92 No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:11:44 +00:00
Roy T. Fielding
16ef40e5ff Remove CGI block on OPTIONS method so that scripts can
respond to OPTIONS directly rather than via server default.

PR: 15242
Reviewed-by: Paul Querna, Andre Malo, William A. Rowe, Jr.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@326255 13f79535-47bb-0310-9956-ffa450edef68
2005-10-18 21:29:43 +00:00
Justin Erenkrantz
7b005585df Fix bug where non-200 CGI responses will not send anything down filter chain.
This is most notable when mod_cache is used.  This has been used in production
on wiki.apache.org for a while now.

* modules/generators/mod_cgi.c
  (cgi_handler): When a non-zero value is returned by scan_script, set the
  status field and ensure that we have an EOS to send down the filer stack.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@231167 13f79535-47bb-0310-9956-ffa450edef68
2005-08-10 04:32:13 +00:00