1
0
mirror of https://github.com/apache/httpd.git synced 2025-06-07 20:02:05 +03:00

68 Commits

Author SHA1 Message Date
Jeff Trawick
4d8f4c26d6 *) SECURITY: CAN-2004-0174 (cve.mitre.org)
Fix starvation issue on listening sockets where a short-lived
     connection on a rarely-accessed listening socket will cause a
     child to hold the accept mutex and block out new connections until
     another connection arrives on that rarely-accessed listening socket.
     With Apache 2.x there is no performance concern about enabling the
     logic for platforms which don't need it, so it is enabled everywhere
     except for Win32.  [Jeff Trawick]

(already in 2.0.49, propagating to mirrors now)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103029 13f79535-47bb-0310-9956-ffa450edef68
2004-03-19 11:16:03 +00:00
Joe Orton
6895aee838 * os/unix/unixd.c (unixd_accept): Eliminate now-redundant call to
apr_os_sock_get(); let APR check for accept returning zero on TPF.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102925 13f79535-47bb-0310-9956-ffa450edef68
2004-03-10 21:06:11 +00:00
André Malo
eeb57c17ad fix name of The Apache Software Foundation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102619 13f79535-47bb-0310-9956-ffa450edef68
2004-02-09 20:40:53 +00:00
André Malo
e0d2db5107 fix copyright dates according to the first check in
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102579 13f79535-47bb-0310-9956-ffa450edef68
2004-02-08 13:13:10 +00:00
André Malo
4f02cb1e18 apply Apache License, Version 2.0
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102525 13f79535-47bb-0310-9956-ffa450edef68
2004-02-06 22:58:42 +00:00
Jeff Trawick
01da1159b3 Unix MPMs: Stop dropping connections when the file descriptor
is at least FD_SETSIZE.

That isn't a problem for most users (since poll() is widespread).
On old boxes where select() must be used by APR, APR needs to fail
operations that don't work with such fds.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102419 13f79535-47bb-0310-9956-ffa450edef68
2004-01-27 15:19:58 +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
3b6b4b4325 fix a compile failure with recent z/OS and picky settings for compiler/
library

("unsigned short" is more portable than "ushort")


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101690 13f79535-47bb-0310-9956-ffa450edef68
2003-11-03 17:30:45 +00:00
Martin Kraemer
46941ae3b8 one_process is not a global variable
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101197 13f79535-47bb-0310-9956-ffa450edef68
2003-09-08 16:39:46 +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
Jeff Trawick
8f0cd048e0 Unix: Handle permissions settings for flock-based mutexes in
unixd_set_global|proc_mutex_perms().  Allow the functions to be
called for any type of mutex.

This resolves a fatal problem with mod_rewrite on systems where
APR uses flock-based mutex.

It simplifies mod_ssl as well, which had special logic to perform
the chown().  It fixed an init error with mod_ssl on systems where
flock is used when the user had no SSLMutex directive.

The Unix MPMs continue to call unixd_set_global|proc_mutex_perms()
only for SysV sems.  There is no permission problem with flock-based
accept mutexes since the child init logic for the MPMs is done
prior to switching identity.

PR:              20312


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100189 13f79535-47bb-0310-9956-ffa450edef68
2003-06-07 19:50:01 +00:00
Greg Ames
b906d05f70 Linux 2.4+: enable coredumps when Apache is started as root if
CoreDumpDirectory is explicitly coded


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98908 13f79535-47bb-0310-9956-ffa450edef68
2003-03-06 21:48:58 +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
1149429227 fix compile breakage with IBM's xlc compiler caused by the
attempt to lose const on progname

strrchr was not the real library function that takes a
const parameter; instead, strrchr was the Apache macro which
makes it clear that const will be lost


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95900 13f79535-47bb-0310-9956-ffa450edef68
2002-06-27 10:47:49 +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
Brian Pane
c09368cc88 Fix for suexec execution of CGI scripts from mod_include
(including security patch to ensure that <!--#include file="name.cgi"-->
is run as the suexec user rather than the httpd user)
PR: 7791, 8291
Submitted by: Colm MacCarthaigh <colmmacc@redbrick.dcu.ie>
Reviewed by:	Brian Pane


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95290 13f79535-47bb-0310-9956-ffa450edef68
2002-05-26 08:27:10 +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
Jeff Trawick
ec5a585bbb APR_PROC_MUTEX_IS_GLOBAL is the condition where apr_global_mutex_t
and apr_proc_mutex_t are interchangeable


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95009 13f79535-47bb-0310-9956-ffa450edef68
2002-05-08 13:19:54 +00:00
Aaron Bannert
c33e4574d8 Add unixd_set_global_mutex_perms so we can set permissions on things like
SysV Semaphores in the core and modules.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94968 13f79535-47bb-0310-9956-ffa450edef68
2002-05-06 18:19:53 +00:00
Justin Erenkrantz
924fc33d06 Fix suexec invocations from userdir - the ~ was not being prepended to the
uid per our convention.  Therefore, bad things would happen (like we
wouldn't cd to the right directory).

Add a flag to the ap_unix_identity_t structure to indicate if we are in
a userdir - if so, prefix the ~.

(Modified by Justin, but Colm's patch pointed me in the right direction.)

PR: 7810
Submitted by:	Colm <colmmacc@redbrick.dcu.ie>
Reviewed by:	Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94791 13f79535-47bb-0310-9956-ffa450edef68
2002-04-25 07:18:40 +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
Brian Pane
90f63dfcd5 Removed unixd_set_lock_perms(apr_lock_t *), which is no longer
used by any of the MPMs.  (This is another step toward eliminating
the httpd's dependencies on the old lock API.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93558 13f79535-47bb-0310-9956-ffa450edef68
2002-02-24 08:33:56 +00:00
Justin Erenkrantz
61d8e967e4 Spelling and grammar janitor coming through.
(Clean up the comment so that mortal beings can parse it.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92895 13f79535-47bb-0310-9956-ffa450edef68
2002-01-17 22:59:48 +00:00
Bill Stoddard
ca30c4d622 On HPUX 11.x, the 'ENOBUFS, No buffer space available'
error occures because the accept() cannot complete.
You will not see ENOBUFS at 10.20 because the kernel
hides any occurrence from being returned from user space.
ENOBUFS at 11.0 TCP/IP is quite possible, and could
occur intermittently. As a work-around, we are going to
ingnore ENOBUFS.

Submitted by: madhusudan_mathihalli@hp.com
Reviewed by: Bill Stoddard


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92894 13f79535-47bb-0310-9956-ffa450edef68
2002-01-17 22:35:09 +00:00
Brian Pane
d5dbe606e3 Clear the output socket descriptor in unixd_accept() to make sure
we don't supply a bogus socket to the caller if the accept fails.
(This was causing problems in the worker MPM, which tried to process
the returned socket if it was non-NULL, even if unixd_accept()
returned an error.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92837 13f79535-47bb-0310-9956-ffa450edef68
2002-01-13 02:35:56 +00:00
Greg Ames
652e5b19ce change ap_unix_create_privileged_process() to allocate enough space in
the newargs array to allow for a null terminator.  This allows suexec and
mod_cgid to work together reliably.

Apparently, rounding up the size to a multiple of 8 bytes in apr_palloc
hid the problem sometimes.  At other times, suexec would complain
about a null command name.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92627 13f79535-47bb-0310-9956-ffa450edef68
2001-12-27 19:53:37 +00:00
Ryan Bloom
91aa604600 Allow modules that add sockets to the ap_listeners list to
define the function that should be used to accept on that
socket.  Each MPM can define their own function to use for
the accept function with the MPM_ACCEPT_FUNC macro.  This
also abstracts out all of the Unix accept error handling
logic, which has become out of synch across Unix MPMs.

The code flow is much easier now for different transports:

1)  During pre-config, post-config or while parsing the config
    file, add a socket to the ap_listeners list, making sure to
    define an accept function at the same time.

2)  MPMs find the correct listener, and call the accept function
    that was defined in step 1.

3)  That accept function returns a void pointer, which is passed
    to the create_connection hook.

4)  create_connection adds the correct low-level filters.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91916 13f79535-47bb-0310-9956-ffa450edef68
2001-11-13 22:42:38 +00:00
Aaron Bannert
648ae56dba Use the APR's new OS-specific proc mutex accessors -- they are used
here to set permissions on SysV Semaphores. MPMs will be modified to
call this new function as they are ported to the new APR lock API.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91579 13f79535-47bb-0310-9956-ffa450edef68
2001-10-19 23:32:43 +00:00
Joshua Slive
ae31fecbff This probably falls under the category: if you can't figure it out yourself,
you shouldn't be doing it.  But we might as well remove obsolete stuff.

PR: 4685


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90527 13f79535-47bb-0310-9956-ffa450edef68
2001-08-23 00:15:37 +00:00
Jeff Trawick
aee4f61414 The Unix MPMs other than perchild now allow child server
processes to use the accept mutex when starting as root and
using SysV sems for the accept mutex.  Previously, this
combination would lead to fatal errors in the child server
processes.  perchild can't use SysV sems because of security
issues.

translation: steal apache 1.3 code to call semop(IPC_SET) on
the semaphore to set permissions and uid/gid


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90213 13f79535-47bb-0310-9956-ffa450edef68
2001-08-16 13:59:14 +00:00
Ryan Bloom
8006145310 Begin to sanitize the MPM configuration directives. Now, all
MPMs use the same functions for all common MPM directives.  This
should make it easier to catch all bugs in these directives once.

Everybody should check their favorite MPM to ensure that it still
compiles, and that these directives work.  This is a big patch, and
although it looks good, and things compiled for me, that is no
garauntee that it will work on all platforms.  :-)

Submitted by:	Cody Sherr <csherr@covalent.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90132 13f79535-47bb-0310-9956-ffa450edef68
2001-08-13 04:57:35 +00:00
Victor J. Orlikowski
45b321443b httpd.exp and lots of other export files are generated based on the
AP[RU]_DECLARE macros. This commit gets mod_cgid working again as a DSO on
AIX.
However, this brings up the need to look for any functions that are
available as part of the API, and AP[RU]_DECLAREing them, so things don't
blow up in DSOs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89790 13f79535-47bb-0310-9956-ffa450edef68
2001-07-30 17:55:38 +00:00
Roy T. Fielding
381f88d56a Update copyright to 2001
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88184 13f79535-47bb-0310-9956-ffa450edef68
2001-02-16 04:26:53 +00:00
Greg Stein
39793c7fca toss the signal description stuff from unixd.[ch], beosd.h, and spmt_os2.
use the new functionality in APR.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88079 13f79535-47bb-0310-9956-ffa450edef68
2001-02-11 00:44:40 +00:00
Doug MacEachern
88d3406f9a renaming various functions for consistency sake
see: http://apr.apache.org/~dougm/apr_rename.pl
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88019 13f79535-47bb-0310-9956-ffa450edef68
2001-02-08 07:45:33 +00:00
William A. Rowe Jr
cd1ef027c2 The changes required for the APR_FINFO_wanted argument to
apr_stat/lstat/getfileinfo.  These are -NOT- optimal, they
  are simply the required changes to get the server working.
  The size of the patch is a warning about how we need to
  really look at what we are trying to accomplish with all
  of these stat/lstat calls.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87760 13f79535-47bb-0310-9956-ffa450edef68
2001-01-20 21:42:23 +00:00
Ryan Bloom
86a67eff47 Move initgroupgs, ap_uname2id and ap_gname2id from util.c to
mpm_common.c.  These functions are only valid on some platforms,
so they should not be in the main-line code.

These functions are also not portable to non-unix platforms, so they don't
really belong in APR.  Since they are only used in MPMs, for right now,
I am moving them to mpm_common.c


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87755 13f79535-47bb-0310-9956-ffa450edef68
2001-01-20 06:05:15 +00:00
William A. Rowe Jr
59bbd68bec The big change. This is part 3 of the apr-util symbols rename, please
see the first commit of srclib/apr-util/include (cvs apr-util/include)
  for the quick glance at symbols changed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87731 13f79535-47bb-0310-9956-ffa450edef68
2001-01-19 07:04:36 +00:00
Ryan Bloom
4d657e4b24 Last change to get SuEXEC working again, and respecting configuration
changes made using autoconf setup.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87539 13f79535-47bb-0310-9956-ffa450edef68
2000-12-27 23:41:16 +00:00
Greg Stein
ead2dae94c *) Compensate for recent changes in the APR headers. Specifically, some
files need to specifically include stdio.h, or a particular apr_*.h
   header.

*) Adjust callers of apr_create_process() to deal with the extra "const"

*) Add "const" to args of ap_os_create_privileged_process()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87080 13f79535-47bb-0310-9956-ffa450edef68
2000-11-26 04:47:43 +00:00
Ryan Bloom
e4fe63f3df Make mod_cgi and mod_include work when compiled as DSO's again. This is
accomplished by moving suexec out of it's own file and into unixd.[ch].
The problem was that suexec.c wasn't being linked into the server unless
a module was actually using ap_os_create_process.  This is still not clean,
but it works now.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86772 13f79535-47bb-0310-9956-ffa450edef68
2000-10-31 00:47:24 +00:00
Manoj Kasichainula
b1fb90877e Add back suexec support.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86712 13f79535-47bb-0310-9956-ffa450edef68
2000-10-23 15:30:57 +00:00
Manoj Kasichainula
603dec1da3 Add a temporary pool argument to unixd_pre_config, so that it can call
APR functions (grumble). This is needed for apr_stat, which will be in
the suexec path coming up.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86710 13f79535-47bb-0310-9956-ffa450edef68
2000-10-23 10:54:18 +00:00
William A. Rowe Jr
d6490633eb Renamed all MODULE_EXPORT symbols to AP_MODULE_DECLARE and all symbols
for CORE_EXPORT to AP_CORE_DECLARE (namespace protecting the wrapper)
  and retitled API_EXPORT as AP_DECLARE and APR_EXPORT as APR_DECLARE.
  All _VAR_ flavors changes to _DATA to be absolutely clear.
  Thank you Greg, for the most obvious suggestion.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86609 13f79535-47bb-0310-9956-ffa450edef68
2000-10-16 06:05:15 +00:00
Jim Jagielski
5e1e8ebb73 We need to test specifically for setrlimit/getrlimit instead of
just the structure or the RLIMIT_* defines. Also, we should make
the API function unixd_set_rlimit() ``available'' even if it
doesn't do anything.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86143 13f79535-47bb-0310-9956-ffa450edef68
2000-08-23 23:28:54 +00:00
Doug MacEachern
059d8dd212 prefix libapr functions and types with apr_
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85976 13f79535-47bb-0310-9956-ffa450edef68
2000-08-02 05:27:38 +00:00
Jeff Trawick
db3c12a79e Fix some bad ap_log_error() invocations. Comment on a bad
ap_log_rerror() invocation.

Almost all of this is in code never compiled.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85860 13f79535-47bb-0310-9956-ffa450edef68
2000-07-17 22:11:47 +00:00
Jeff Trawick
b5c0ae056b Include strings.h for strcasecmp(), strncasecmp(), and bzero().
Include time.h for time().

This removes a bunch of compiler warnings with gcc -Wall on AIX.
Submitted by:	Jeff Trawick, Victor Orlikowski


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85723 13f79535-47bb-0310-9956-ffa450edef68
2000-06-28 14:33:48 +00:00
Ryan Bloom
0a82e00316 Remove unixd_detach function, because it is provided by APR as ap_detach.
This also modifies the ap_detach function to look like unixd_detach.
Finally all calls to unixd_detach are changed to ap_detach.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85635 13f79535-47bb-0310-9956-ffa450edef68
2000-06-20 19:16:18 +00:00
Jeff Trawick
43befa39e1 Make unixd_config.user_name const char * instead of char * to avoid
a warning when the set-user-name command handler saves the address of
the arg from the config file.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85606 13f79535-47bb-0310-9956-ffa450edef68
2000-06-18 03:05:41 +00:00