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

230 Commits

Author SHA1 Message Date
Colm MacCarthaigh
c8e6fa78af Fix PR36410; Change how the get_suexec_identity hook is handled by CGID.
Instead of using mod_userdir and mod_suexec specific hacks, we now run the hook
on the httpd side of the handler. 

If this is NULL, we pass on a magic empty_ugid constant, otherwise pass on the
real ugid.

On the cgid side of the equation, we add our own hook, with REALLY_FIRST, and
then order the hooks. This ensures that cgid's doer runs before any other
registered get_suexec_identity doers.

We use cgid's request config to store the ugid. If ugid == empty_ugid, we DON'T
call ap_os_create_privileged_process, because our doer would return the magic
empty_ugid constant. Having the doer return NULL is no good, because then
userdir and mod_suexec's doers would be called. Instead, we call plain old
apr_proc_create(). 



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@264759 13f79535-47bb-0310-9956-ffa450edef68
2005-08-30 11:26:45 +00:00
William A. Rowe Jr
f87b4c1af1 Correct mod_cgid's argv[0] so that the full path can be delved by the
invoked cgi application, to conform to the behavior of mod_cgi.

PR: 34542
Reviewed by: Andre, OtherBill
Submitted by: Pradeep Kumar S <pradeep.smani gmail.com>



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@264623 13f79535-47bb-0310-9956-ffa450edef68
2005-08-29 20:12:43 +00:00
Colm MacCarthaigh
de0b459ab0 CGId keeps a copy of the listening sockets open, which interferes with a
graceful shutdown/start. Close the listening sockets on cgid start.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@241815 13f79535-47bb-0310-9956-ffa450edef68
2005-08-27 23:05:42 +00:00
Colm MacCarthaigh
b379e699a4 Append the .PID to the ScriptSock filename. This change ensures that multiple
running instances of httpd will not clobber each others script sockets. 

Because a different socket will be created for each instance, this change also
unlinks the script-socket on exit, to prevent pollution. 

unlink() happens from within the parent process, since the change in userid's
means the cgid process likely won't have the correct permissions.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@240044 13f79535-47bb-0310-9956-ffa450edef68
2005-08-25 11:51:24 +00:00
Colm MacCarthaigh
e3d4e1fe50 nit: Consistently CamelCase "ScriptSock".
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@240043 13f79535-47bb-0310-9956-ffa450edef68
2005-08-25 10:56:12 +00:00
Andreas Steinmetz
aec1dab812 fix 64bit build warnings
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@239423 13f79535-47bb-0310-9956-ffa450edef68
2005-08-23 16:06:24 +00:00
Jeff Trawick
badfb79c67 mod_cgid: Fix buffer overflow processing ScriptSock directive.
Submitted by:        Steve Kemp <steve steve.org.uk>
Reviewed/tweaked by: trawick



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@192995 13f79535-47bb-0310-9956-ffa450edef68
2005-06-22 20:54:28 +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
Jeff Trawick
f8e41a4112 mod_cgid: Catch configuration problem where two web server instances
share same ServerRoot but admin forgot to use ScriptSock.

reviewed by: nd, stoddard


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@106408 13f79535-47bb-0310-9956-ffa450edef68
2004-11-24 11:24:32 +00:00
Joe Orton
65153a5687 * modules/generators/mod_cgid.c (cgid_init): Fix GCC strict-aliasing
warning.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105753 13f79535-47bb-0310-9956-ffa450edef68
2004-11-12 10:16:01 +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
Martin Kraemer
1577a9adf6 Let CGI daemon die if the network layer has been shut down (problem noticed on BS2000/OSD)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104080 13f79535-47bb-0310-9956-ffa450edef68
2004-06-29 13:48:20 +00:00
Joe Orton
ef03042845 * modules/generators/mod_cgid.c (cgid_server, set_script_socket):
Remove unused variables.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103209 13f79535-47bb-0310-9956-ffa450edef68
2004-03-30 10:57:30 +00:00
Jeff Trawick
8fcedf0718 mod_cgid: Don't allow Scriptsock to be specified inside VirtualHost;
Don't place script socket inside default server root instead of
actual server root.

The sock name was being stored in the server config, though it
was not specific to a server.

ap_server_root_relative() was being used prior to config processing,
so it was always picking up the default server root.

PR:            27886


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103184 13f79535-47bb-0310-9956-ffa450edef68
2004-03-29 02:56:21 +00:00
Jeff Trawick
18edbaaf56 mod_cgid: Fix storage corruption caused by use of incorrect pool.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102961 13f79535-47bb-0310-9956-ffa450edef68
2004-03-15 20:00:13 +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
Jeff Trawick
8dfff0a318 change the way the cgid daemon restart logic determines whether
or not the MPM is still running...   now it works with prefork
MPM too


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102046 13f79535-47bb-0310-9956-ffa450edef68
2003-12-13 19:09:00 +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
c76efd6bfb Fix a long delay with CGI requests and keepalive connections on
AIX.

On AIX, for processes like mod_cgid's script children where
SIGCHLD is ignored, kill(pid,0) returns success for up to
one second after the script child exits, based on when a
daemon runs to clean up unnecessary process table entries.
getpgid() can report the proper info (-1/ESRCH) immediately.

One user had a page with a lot of embedded images created by
CGIs, and the browser fetched them on a keepalive connection,
and the cumulative delays were very noticeable by the clients.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101716 13f79535-47bb-0310-9956-ffa450edef68
2003-11-07 15:26:34 +00:00
Sander Striker
3e4547ab87 Forward port from 2.0:
SECURITY [CAN-2003-0789]: mod_cgid: Resolve some mishandling of
the AF_UNIX socket used to communicate with the cgid daemon and
the CGI script.

Submitted by: Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101570 13f79535-47bb-0310-9956-ffa450edef68
2003-10-26 23:25:44 +00:00
Jeff Trawick
be1143ae61 mod_cgid: fix a hash table corruption problem which could
result in the wrong script being cleaned up at the end of a
request.

Unique storage was not used for the key, as the code assumed
incorrectly that apr_hash_set() made a copy of the key.  Thus,
when the script pid was looked up at the end of the request,
some other script's pid could be found.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101374 13f79535-47bb-0310-9956-ffa450edef68
2003-10-02 11:58:57 +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
André Malo
9f542e55f3 include_cmd doesn't imply the CGI interface. That code seems to be
a c&p accident.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101039 13f79535-47bb-0310-9956-ffa450edef68
2003-08-20 22:47:52 +00:00
Jeff Trawick
ace2765ea7 mod_cgid: Restart the cgid daemon if it crashes.
PR:             19849
Submitted by:   Glenn Nielsen <glenn@apache.org>
Reviewed by:    Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100343 13f79535-47bb-0310-9956-ffa450edef68
2003-06-23 20:17:00 +00:00
Jeff Trawick
6a371fa684 mod_cgid: Eliminate a double-close of a socket. This resolves
various operational problems in a threaded MPM, since on the
second attempt to close the socket, the same descriptor was
often already in use by another thread for another purpose.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100320 13f79535-47bb-0310-9956-ffa450edef68
2003-06-20 22:53:15 +00:00
William A. Rowe Jr
6c2b1c739a Fix a misterminated comment... noted by bpane
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99142 13f79535-47bb-0310-9956-ffa450edef68
2003-03-31 06:12:00 +00:00
William A. Rowe Jr
686f8cf5ae Solve segfaults from unusual error exceptions in cgid. The daemon
has no 'real' request_rec, so we can't use ap_log_rerror() anywhere
  within the cgid_server() code.

  Also, one of the two log messages was echoed to the child, no point
  when the actual request logic should take care of that notification.

Submitted by:	Jeff Trawick
Reviewed by:	Bill Rowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99132 13f79535-47bb-0310-9956-ffa450edef68
2003-03-31 04:44:11 +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
f0ab8f426a mod_cgid: Handle environment variables containing newlines.
Communication between handler and daemon used newlines to delimit
environment variables, which threw everything off when an environment
variable contained a newline.

Communication between handler and daemon was extensively reworked.
Environment variables were handled as in the patch submitted by
Piotr Czejkowski.

PR:              14550
Submitted by:	 Piotr Czejkowski <apache@czarny.eu.org>, Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97530 13f79535-47bb-0310-9956-ffa450edef68
2002-11-15 02:49:29 +00:00
Jeff Trawick
658cf25ab4 watch out for the should-not-occur condition where the daemon can't
find the script pid in the hash and returns zero...  if we send
sigterm to pid zero, we knock out ourself

change the cleanup to return any error from cleanup_nonchild_process()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97493 13f79535-47bb-0310-9956-ffa450edef68
2002-11-12 12:23:42 +00:00
Jeff Trawick
2f9e68ef61 mod_cgid: Terminate CGI scripts when the client connection
drops.

This is done by mod_cgid daemon remembering the pid, which is queried
by the handler at the end of the request.  The handler then
knocks out the CGI script (if it is indeed still running).

It would be slightly easier for the daemon to do this, but naughty
scripts which are hard to kill would hold up all new CGI requests
if the daemon stopped its normal processing to kill a script.

PR:		8388


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97489 13f79535-47bb-0310-9956-ffa450edef68
2002-11-11 23:07:29 +00:00
Jeff Trawick
b143c6acc6 add a comment lamenting the lack of a cleanup for the CGI child
process and mentioning some issues related to the problem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97362 13f79535-47bb-0310-9956-ffa450edef68
2002-10-31 09:30:43 +00:00
Jeff Trawick
53f940a84a Fix a problem with streaming script output and mod_cgid. We have
to tell APR that the socket can be treated as a pipe so that the
apr_file_t is initialized properly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97087 13f79535-47bb-0310-9956-ffa450edef68
2002-10-03 18:15:34 +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
William A. Rowe Jr
9f4d3ce860 s/cgi/cgid might be just a little agressive - fix a comment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95852 13f79535-47bb-0310-9956-ffa450edef68
2002-06-23 04:03:21 +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
Brian Pane
db8d5fe1d7 Pass the brigade even on header_only requests
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95653 13f79535-47bb-0310-9956-ffa450edef68
2002-06-13 19:41:17 +00:00
William A. Rowe Jr
5cf5552b11 Use lowercased macros
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95620 13f79535-47bb-0310-9956-ffa450edef68
2002-06-12 22:27:37 +00:00
William A. Rowe Jr
9db1cc663f Use the new wrapper
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95617 13f79535-47bb-0310-9956-ffa450edef68
2002-06-12 16:56:58 +00:00
Justin Erenkrantz
9cd9ec170f Apply same patch to mod_cgid that was applied to mod_cgi so that it
bypasses the *_client_block calls in favor of using the input filters
and brigades directly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95385 13f79535-47bb-0310-9956-ffa450edef68
2002-05-30 05:42:46 +00:00
Jeff Trawick
4792a8c423 fix a char signed-ness mismatc in the call to apr_table_set()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95306 13f79535-47bb-0310-9956-ffa450edef68
2002-05-27 10:28:17 +00:00
Cliff Woolley
6acb2a7d42 style police take 2
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95295 13f79535-47bb-0310-9956-ffa450edef68
2002-05-26 23:00:19 +00:00
Cliff Woolley
5a25f1fe66 style police
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95294 13f79535-47bb-0310-9956-ffa450edef68
2002-05-26 22:56:45 +00:00