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
Joe Orton
329615343c * modules/generators/mod_cgi.c (cgi_bucket_read): Log a specific error
if a timeout occurs from a blocking read; more helpful than a generic
"apr_bucket_read failed" error from some higher-up filter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@189560 13f79535-47bb-0310-9956-ffa450edef68
2005-06-08 08:50:19 +00:00
Justin Erenkrantz
905cdf9f0b Update copyright year to 2005 and standardize on current copyright owner line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 20:28:49 +00:00
Joe Orton
a4063b9fba * modules/generators/mod_cgi.c (cgi_handler): Ensure all stderr from
the script is logged if it generated a non-local redirect.

PR: 20111


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@106195 13f79535-47bb-0310-9956-ffa450edef68
2004-11-22 16:03:20 +00:00
Joe Orton
c48cfec2fd * server/util_filter.c (ap_save_brigade): Handle an ENOTIMPL setaside
function correctly.

* modules/generators/mod_cgi.c (cgi_handler): Revert r1.169,
unnecessary CGI bucket lifetime kludge.

PR: 31247


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105297 13f79535-47bb-0310-9956-ffa450edef68
2004-09-26 15:52:51 +00:00
Joe Orton
c69b0be29f * modules/generators/mod_cgi.c (cgi_handler): Fix possible segfaults
in CGI bucket methods if invoked from a subrequest.

PR: 31247


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105250 13f79535-47bb-0310-9956-ffa450edef68
2004-09-22 15:38:02 +00:00
André Malo
a97ed90edf #ifndef AP_UNSAFE_ERROR_LOG_UNESCAPED the stderr to errorlog stuff
for those who don't want to escape (as in server/log.c)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104834 13f79535-47bb-0310-9956-ffa450edef68
2004-08-26 20:50:55 +00:00
Bill Stoddard
e0c3bc4dcb Escape bytes returned by the errfn because it might be from an untrusted source
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104780 13f79535-47bb-0310-9956-ffa450edef68
2004-08-24 01:49:59 +00:00
Justin Erenkrantz
022f0af97c Remove deprecated APR_STATUS_IS_SUCCESS() macro in favor of direct test against
APR_SUCCESS.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104439 13f79535-47bb-0310-9956-ffa450edef68
2004-08-01 01:12:30 +00:00
Jean-Jacques Clar
227df09ee4 rev back to previous version, removing chnges to overload detach field , putting back addrspace field
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104251 13f79535-47bb-0310-9956-ffa450edef68
2004-07-12 16:53:24 +00:00
Jean-Jacques Clar
f2e3f86232 Overloading detached field in cgi_exec_info_t stuct in order to use same field to set detached and addrspace values for proc to be started.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104209 13f79535-47bb-0310-9956-ffa450edef68
2004-07-09 20:28:48 +00:00
Jean-Jacques Clar
136ee08033 Added new field in apr_procattr_t and cgi_exec_info_t structures to support loading in current or new address space (NetWare ONLY).
Replaced changes that added APR_PROGRAM_ADDRSPACE committed 6/11/04.
Reviewed by Brad Nicholes


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103946 13f79535-47bb-0310-9956-ffa450edef68
2004-06-14 17:28:25 +00:00
Joe Orton
0df6a7dbfe * modules/generators/mod_cgi.c (cgi_handler): Soak up stderr from nph-
scripts correctly.

PR: 18348
Submitted by: Jeff Trawick (in mod_jcgi)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103622 13f79535-47bb-0310-9956-ffa450edef68
2004-05-05 15:30:53 +00:00
Joe Orton
46fb957d01 * modules/generators/mod_cgi.c (cgi_handler): Combine common code
between nph and non-nph handling; use a CGI bucket for both cases if
APR_FILES_AS_SOCKETS.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103621 13f79535-47bb-0310-9956-ffa450edef68
2004-05-05 14:52:44 +00:00
Joe Orton
d4cb879b8f Implement the "CGI bucket" in mod_cgi to handle stderr output during
script execution, preventing deadlock if stderr output fills the pipe
buffer:

* modules/generators/mod_cgi.c (log_script_err): Return a read error.
(cgi_bucket_create, cgi_bucket_dup, cgi_read_stdout, cgi_bucket_read):
New functions.
(cgi_handler): Use new CGI bucket rather than a pipe bucket if
APR_FILES_AS_SOCKETS; use zero read timeout from stdout/stderr during
script execution.

PR: 22030
Submitted by: Joe Orton, Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103437 13f79535-47bb-0310-9956-ffa450edef68
2004-04-18 16:02:57 +00:00
André Malo
a688f06b19 fix name of The Apache Software Foundation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102618 13f79535-47bb-0310-9956-ffa450edef68
2004-02-09 20:31:03 +00:00
André Malo
d0e05bada9 fix copyright dates according to the first check in
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102565 13f79535-47bb-0310-9956-ffa450edef68
2004-02-08 12:07:22 +00:00
André Malo
0d57db3af2 apply Apache License, 2.0
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102524 13f79535-47bb-0310-9956-ffa450edef68
2004-02-06 22:19:28 +00:00
André Malo
fb07607180 update license to 2004.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102135 13f79535-47bb-0310-9956-ffa450edef68
2004-01-01 13:26:26 +00:00
Cliff Woolley
aaf0424e2b get rid of _FOREACH
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101788 13f79535-47bb-0310-9956-ffa450edef68
2003-11-16 02:09:14 +00:00
Jeff Trawick
aa21671e13 switch to APR 1.0 API (which is still in flux)
because of the changes to the argument lists of apr_mmap_dup and apr_socket_create,
2.1-dev won't build with apr and apr-util's 0.9 branch anymore


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101154 13f79535-47bb-0310-9956-ffa450edef68
2003-09-03 19:27:12 +00:00
André Malo
b37c094b16 drop superfluous argument from ap_ssi_parse_string.
The new API should now be stable.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101069 13f79535-47bb-0310-9956-ffa450edef68
2003-08-22 23:14:30 +00:00
André Malo
728dc394a9 adjust mod_cgi and mod_cgid
bump MMN for API change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101047 13f79535-47bb-0310-9956-ffa450edef68
2003-08-21 22:12:08 +00:00
Jeff Trawick
25be2b6a89 Fix the inability to log errors like exec failure in
mod_ext_filter/mod_cgi script children (e.g., exec failure).  This
was broken after such children stopped inheriting the error log
handle.

(For this to work with mod_ext_filter, that module's LogStderr option
has to be on.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99211 13f79535-47bb-0310-9956-ffa450edef68
2003-04-04 18:55:49 +00:00
Jeff Trawick
b535985b9b mod_cgi, mod_cgid, mod_ext_filter: Log errors when scripts cannot
be started on Unix because of such problems as bad permissions,
bad shebang line, etc.

Some minor points:

If mod_ext_filter debug is enabled, we go ahead and burn cycles
in the parent to try to discover when we won't be able to exec
the script.

The mod_cgid handler wasn't communicating the right log level to the
daemon; that was required to get the child errfn to spit out the
right message, and it may fix an existing problem.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98630 13f79535-47bb-0310-9956-ffa450edef68
2003-02-12 18:27:37 +00:00
André Malo
742af25096 finished that boring job:
update license to 2003.

Happy New Year! ;-))


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98573 13f79535-47bb-0310-9956-ffa450edef68
2003-02-03 17:53:28 +00:00
Jeff Trawick
bd108a8478 Fix the building of cgi command lines when the query string
contains '='.

PR:              13914
Submitted by:	 Ville Skytt� <ville.skytta@iki.fi> (mod_cgi)
                 Jeff Trawick (mod_cgid)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97601 13f79535-47bb-0310-9956-ffa450edef68
2002-11-22 14:45:19 +00:00
Jeff Trawick
6c584036fd Terminate CGI scripts when the client connection drops. This
fix only applies to some normal paths in mod_cgi.  mod_cgid
is still busted.

A prereq for this fix is the change to content-length filter to
notice c->aborted:

http://cvs.apache.org/viewcvs.cgi/httpd-2.0/server/protoc
ol.c.diff?r1=1.119&r2=1.120&diff_format=h

PR:         8388


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97364 13f79535-47bb-0310-9956-ffa450edef68
2002-10-31 11:53:43 +00:00
Bill Stoddard
5d53209f9b Log error message to the client without the path name.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96241 13f79535-47bb-0310-9956-ffa450edef68
2002-07-30 18:18:03 +00:00
Ryan Bloom
b274510242 Fix a long-standing bug in 2.0, CGI scripts were being called
with relative paths instead of absolute paths.  Apache 1.3 used
absolute paths for everything except for SuExec, this brings back
that standard.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95899 13f79535-47bb-0310-9956-ffa450edef68
2002-06-27 06:07:58 +00:00
William A. Rowe Jr
7f1ed02c5e Simplify add_ssi_vars() and move the ssi/cgi vars into their respective
functions [so we may address r->subprocess_env in the ap_cgi_build_command
  win32 handler.]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95853 13f79535-47bb-0310-9956-ffa450edef68
2002-06-23 04:05:17 +00:00
William A. Rowe Jr
c959a9ace8 Note the changed meaning of the NULL next_filter argument to the
ap_sub_req_lookup() family, and fix a few oddball cases (those are,
  PATH_TRANSLATED reference issues.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95844 13f79535-47bb-0310-9956-ffa450edef68
2002-06-22 16:32:45 +00:00
Justin Erenkrantz
b5bc68a4d2 Per RFC 2616 section 9.4, we SHOULD return the content-length if possible on
HEAD requests (even for CGI requests).  Also do it because it fixes the cause
of .37's demise.

This also fixes a condition seen on FreeBSD-4.6 where HEAD requests on CGI
scripts would hang because the OS would return EAGAIN in log_script_err
(via apr_file_gets).  Since we never read the script output, this caused
FreeBSD to not let us read stderr.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95633 13f79535-47bb-0310-9956-ffa450edef68
2002-06-13 06:36:40 +00:00
William A. Rowe Jr
7af68c0bf5 Solve the 80/20 by initializing and storing server_rec->timeout and
server_rec->keep_alive_timeout in apr_time_interval_t format (in apr
  units, whatever they be), as both values exist to pass into APR, and
  all APR timeouts are in apr_time_t.

Reviewed by:	Cliff Woolley


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95623 13f79535-47bb-0310-9956-ffa450edef68
2002-06-12 23:59:31 +00:00
William A. Rowe Jr
923f2a39b0 Cleanup an emit
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95536 13f79535-47bb-0310-9956-ffa450edef68
2002-06-06 00:16:59 +00:00
Bradley Nicholes
4291eb89de Consolidated the startup attributes for building the command line for a CGI
binary into a single structure.  This allows platform integrator to manipulate
the startup parameters much more easily.  Also added the detach attribute
so that each CGI binary can be spawn appropriately for the OS.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95534 13f79535-47bb-0310-9956-ffa450edef68
2002-06-05 22:58:03 +00:00
Justin Erenkrantz
4e551fce25 Rewrite mod_cgi's input handling to use brigades and input filters directly.
This removes the unnecessary overhead of the *_client_block functions.

Optimize usage of the dbuf char* (don't do pcalloc on it!)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95376 13f79535-47bb-0310-9956-ffa450edef68
2002-05-30 00:36:58 +00:00
Justin Erenkrantz
18e58091f7 - Remove APR_STATUS_IS_SUCCESS calls in favor of directly testing APR_SUCCESS.
- Minor style nit with spaces.
(No functional changes.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95374 13f79535-47bb-0310-9956-ffa450edef68
2002-05-30 00:30:28 +00:00
Justin Erenkrantz
3686302d01 Call apr_file_write_full instead to achieve the same effect.
apr_file_write_full is *guaranteed* to either write everything or return
an error.  It'll only write short if it received an error.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95371 13f79535-47bb-0310-9956-ffa450edef68
2002-05-29 23:06:12 +00:00
Justin Erenkrantz
f728b15f24 Stylistic changes - remove tabs, clean up long lines, etc.
(No functional changes.)
(Functional optimizations/cleanups coming later...)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95369 13f79535-47bb-0310-9956-ffa450edef68
2002-05-29 22:27:37 +00:00
Jeff Trawick
bc0cf18899 stop using APLOG_NOERRNO in calls to ap_log_[pr]error()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95151 13f79535-47bb-0310-9956-ffa450edef68
2002-05-17 11:33:10 +00:00
Cliff Woolley
768d65eeac AcceptPathInfo was totally backwards... it would reject when set to on and
by default and accept when set to off for the default handler, and would
reject only if set to accept for mod_cgi(d) and mod_isapi.

PR: 8234


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94751 13f79535-47bb-0310-9956-ffa450edef68
2002-04-22 08:08:38 +00:00
William A. Rowe Jr
e97e2e539c process_cgi is more descriptive than replace_cmd.
It also affects query_string args.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94638 13f79535-47bb-0310-9956-ffa450edef68
2002-04-13 20:42:35 +00:00
William A. Rowe Jr
fe28459eb0 Wasted at least 20 minutes reparsing this code till I determined it's
correct.  But make the sucker legible so noone else repeats the experience.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94635 13f79535-47bb-0310-9956-ffa450edef68
2002-04-13 19:52:59 +00:00
William A. Rowe Jr
596ccf1b44 In order for Win32 to accept the shebang line of #!perl so we 1) search
the PATH and 2) resolve perl.exe for perl, we must add the progtype so
  we can override APR_PROGRAM with APR_PROGRAM_PATH.  This is the API change
  only for the cgi build command line option function.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94634 13f79535-47bb-0310-9956-ffa450edef68
2002-04-13 19:50:46 +00:00
Brian Pane
3f381e30d6 Fixed script error logging, which I'd left commented out after making
the changes to use a brigade to read the script headers
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94343 13f79535-47bb-0310-9956-ffa450edef68
2002-03-30 23:11:55 +00:00
Cliff Woolley
3e2ce19baf BUCKET FREELISTS
Add an allocator-passing mechanism throughout the bucket brigades API.

From Apache's standpoint, the apr_bucket_alloc_t* used throughout a given
connection is stored in the conn_rec by the create_connection hook.  That
means it's the MPM's job to optimize recycling of apr_bucket_alloc_t's --
the MPM must ensure that no two threads can ever use the same one at the
same time, for instance.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94304 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 08:17:26 +00:00
Jeff Trawick
2030234ca7 eliminate unused variables
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94152 13f79535-47bb-0310-9956-ffa450edef68
2002-03-24 02:55:35 +00:00
Brian Pane
804f94d21f Changed mod_cgi to not do single-byte reads to consume the
script headers


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94151 13f79535-47bb-0310-9956-ffa450edef68
2002-03-23 23:19:41 +00:00
William A. Rowe Jr
e8dd037868 An error is an error. Since we replace the message with 'failed to
invoke command; ...' we aught to log it at the right level.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94122 13f79535-47bb-0310-9956-ffa450edef68
2002-03-22 06:51:52 +00:00
William A. Rowe Jr
3105b7eaa1 Trace the invoked command when we use CreateProcess()-style emulation
of execxx() for apr_proc_create().


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94119 13f79535-47bb-0310-9956-ffa450edef68
2002-03-22 06:09:39 +00:00