1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-05 05:30:39 +03:00
Commit Graph

199 Commits

Author SHA1 Message Date
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
Bill Stoddard
d5c24720dc Commit 1 of 2 to:
1. rename ap_rset_content_type to ap_set_content_type
2. reverse the arguments on the call to aligh with ap_set_content_length


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94056 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 17:41:55 +00:00
Jeff Trawick
5f8b426d1d Get nph- CGI scripts working again by avoiding filters that can't
possibly deal with a script that generates the protocol header.

PR:       8902, 8907, 9983


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94052 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 13:57:08 +00:00
Bill Stoddard
470edb9dd8 First commit to introduce accessor function to set r->content_type..
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94027 13f79535-47bb-0310-9956-ffa450edef68
2002-03-20 01:58:47 +00:00
William A. Rowe Jr
65a37752ec Eliminate potential ap_server_root_relative segfaults, with the input
of Jeff Trawick's style changes to the first patches.  Doesn't include
  the fixes to ssl [more complex], and we won't trap errors that involve
  ap_serverroot, since we presume that was normalized on the way in.
  Therefore, testing ap_server_root_relative(DEFAULT_FOO) cases
  should never become necessary.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93965 13f79535-47bb-0310-9956-ffa450edef68
2002-03-16 18:26:58 +00:00
Jeff Trawick
2df1a02f72 deal with the rename of kill_after_timeout to APR_KILL_AFTER_TIMEOUT
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93940 13f79535-47bb-0310-9956-ffa450edef68
2002-03-14 22:19:14 +00:00
Roy T. Fielding
845cbfd508 Update our copyright for this year.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93918 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 20:48:07 +00:00
Justin Erenkrantz
1b1337e4df Fixup DEBUG_CGI code paths to compile and not leak fds.
PR: 9670, 9671
Submitted by:   David MacKenzie <djm@pix.net>
Reviewed by:	Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93474 13f79535-47bb-0310-9956-ffa450edef68
2002-02-18 06:15:38 +00:00
Justin Erenkrantz
4b72cda81a Correctly check script_in variable.
(script_out and script_err are already correct.)
PR: 9669


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93468 13f79535-47bb-0310-9956-ffa450edef68
2002-02-18 03:31:27 +00:00
William A. Rowe Jr
453e7e7c54 Ever tried to extract some value of QUERY_STRING from within SSI?
Now you can :)  Provides $0..$9 results for any regex evaluation,
  and strengthens the expr parser for regex expressions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92676 13f79535-47bb-0310-9956-ffa450edef68
2001-12-31 05:58:59 +00:00
Cliff Woolley
436ecd5553 Related to Brian's commit to fix the XXX comments I'd added a while back.
These lines were broken too, I just hadn't commented them.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92609 13f79535-47bb-0310-9956-ffa450edef68
2001-12-26 17:31:48 +00:00
Brian Pane
5287c6ea9e Fixed calculation of bucket lengths
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92601 13f79535-47bb-0310-9956-ffa450edef68
2001-12-26 08:58:55 +00:00
William A. Rowe Jr
67c3d93b2c Apply the converse of the AcceptPathInfo patch for isapi's/cgi's.
The default behavior remains, accept PATH_INFO, but it may be expressly
  revoked with AcceptPathInfo Off


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92452 13f79535-47bb-0310-9956-ffa450edef68
2001-12-13 17:22:20 +00:00
Ryan Bloom
e674055ddb Fix the cmd command for mod_include. When we are processing
a cmd command, we do not want to use the r->filename to set
the command name.  The command comes from the SSI tag.  To do this,
I added a variable to the function that builds the command line
in mod_cgi.  This allows the include_cmd function to specify
the command line itself.

PR:	8772


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92150 13f79535-47bb-0310-9956-ffa450edef68
2001-11-24 00:17:01 +00:00
Ian Holsman
86b792b21c Modify post_config hook so that it can return a error,
causing the server not to start.
previous method was to call exit(1) which would not fail
gracefully

PR:
Obtained from:
Submitted by:
Reviewed by:	(Idea only Jeff Trawick)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92144 13f79535-47bb-0310-9956-ffa450edef68
2001-11-23 16:35:22 +00:00
Bill Stoddard
e79f552386 Performance: Move the is_included strcmp to after the check to see if the
request is to be served by the cgi handler.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91876 13f79535-47bb-0310-9956-ffa450edef68
2001-11-12 16:32:33 +00:00
Cliff Woolley
d08f8fb019 Port Justin's mod_cgid change to mod_cgi.
mod_cgi wasn't actually broken in the way that mod_cgid was, but
it's still good do have these checks be against APR_SUCCESS rather
than 0 for clarity.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91868 13f79535-47bb-0310-9956-ffa450edef68
2001-11-12 04:34:13 +00:00
Cliff Woolley
468199afcb Remove the returned-length "w" parameter from apr_bucket_heap_create()
and apr_bucket_heap_make().  It was useless, since the length is invariant
from the length passed in and from the resulting bucket's b->length.  This
takes care of a long-standing issue first brought up in February and
discussed on the dev@apr list.  (Issue #2 from the "Bucket API Cleanup
Issues" thread.)

See http://marc.theaimsgroup.com/?l=apr-dev&m=98324983126666&w=2

Reviewed by:    Ryan Bloom (concept)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91866 13f79535-47bb-0310-9956-ffa450edef68
2001-11-12 03:23:12 +00:00
Ian Holsman
eea38d7c2e This patch changes the apr_table_elts macro so that it provides
access to the internals of an apr_table_t via a const pointer
instead of the current non-const pointer.


Submitted by:	Brian Pane <BPane@pacbell.net>
Reviewed by:	Ian Holsman


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91860 13f79535-47bb-0310-9956-ffa450edef68
2001-11-11 22:31:04 +00:00
Cliff Woolley
0db50e73c4 Fix constness problem reported by gcc:
mod_cgi.c: In function `include_cmd':
mod_cgi.c:812: warning: passing arg 1 of pointer to function from incompatible
pointer type

Reported by:	Ian's autobuild


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91062 13f79535-47bb-0310-9956-ffa450edef68
2001-09-18 03:33:30 +00:00
William A. Rowe Jr
772d477ee0 Here's the declaration for all to share. Don't expect many to use it.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91059 13f79535-47bb-0310-9956-ffa450edef68
2001-09-17 22:12:49 +00:00
William A. Rowe Jr
f495937085 Remove the Win32 script-processing exception from mod_cgi, and
roll build_command_line/build_argv_list into a unified, overrideable
   ap_cgi_build_command optional function.

   Eliminates a ton of Win32 cruft from core.c for registry parsing.
   Win32 (through the default handler, and newest changes to the
   apr_proc_create fn) continues to serve .bat/.exe files.  This is in
   preparation for adding modules/arch/win32/mod_win32 for scripts.

   Please review the mod_cgi.c behavior very carefully.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91058 13f79535-47bb-0310-9956-ffa450edef68
2001-09-17 21:07:36 +00:00
Paul J. Reder
f2e3713193 Moved split_and_pass_pretag_buckets back to being a
macro at Ryans's request. Removed the return from it
by setting and returning a return code instead. Updated
the code to check the return code from teh macro and
do the right thing.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90735 13f79535-47bb-0310-9956-ffa450edef68
2001-08-27 20:25:42 +00:00
Jeff Trawick
a1a33b3115 fix what would seem to be a serious problem in
split_and_pass_pretag_buckets(): the retcode is not
specified on one of the paths


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90600 13f79535-47bb-0310-9956-ffa450edef68
2001-08-24 00:47:09 +00:00
William A. Rowe Jr
2902f2da92 Optimize out what is a very expensive in-request call to
ap_server_root_relative (and is becoming more expensive).
  Now the call happens in the config phase where it belongs.
  Note someone can hop in and transpose the stat and open
  with an open and getfileinfo if you are a performance hound.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90563 13f79535-47bb-0310-9956-ffa450edef68
2001-08-23 18:53:27 +00:00
Paul J. Reder
9067bdbe2b Fix for mod_include. Ryan's patch to check error
codes put a return in the wrong place. Also, the
include handler return code wasn't being checked.
I don't like macros with returns, so I converted
SPLIT_AND_PASS_PRETAG_BUCKETS into a function.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90554 13f79535-47bb-0310-9956-ffa450edef68
2001-08-23 15:45:49 +00:00