Commit Graph

137 Commits

Author SHA1 Message Date
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
103f776c25 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@1174748 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:38:09 +00:00
625b89a7e2 Add in MaxRangeOverlaps and MaxRangeReversals to accomodate
more control over acceptable Range headers:

        See: http://trac.tools.ietf.org/wg/httpbis/trac/ticket/311

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1169756 13f79535-47bb-0310-9956-ffa450edef68
2011-09-12 14:15:53 +00:00
fe5f7b561d take care of some MaxRanges feedback:
* allow "none" to be expressed in config
 * send Accept-Ranges: none with MaxRanges none
 * stop accepting confusing/ambiguous "0", start accepting "unlimited".



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1166282 13f79535-47bb-0310-9956-ffa450edef68
2011-09-07 17:29:49 +00:00
1aaea94cb5 add MaxRanges directive institute a default limit of 200 (post-merge where
applicable) Ranges before returning the complete resource.

(minor mmn bump for core_dir_config addition)



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1162584 13f79535-47bb-0310-9956-ffa450edef68
2011-08-28 20:35:07 +00:00
0d69087127 Add AllowOverrideList directive and documentation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1151654 13f79535-47bb-0310-9956-ffa450edef68
2011-07-27 22:24:14 +00:00
fba947527f Introduce new function ap_get_conn_socket() to access the socket of
a connection


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1135153 13f79535-47bb-0310-9956-ffa450edef68
2011-06-13 16:02:18 +00:00
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
feca55db60 - Introduce concept of context prefix (which is an URL prefix)
and context document root (which is the file system directory that
  this URL prefix is mapped to). This generalization of the document
  root makes it easier for scripts to create self-referential URLs and
  to find their files.
- Expose CONTEXT_DOCUMENT_ROOT and CONTEXT_PREFIX as envvars, in mod_rewrite,
  and in ap_expr.
- Make mod_alias and mod_userdir set the context information.
- Allow to override the document root on a per-request basis. This allows
  mass vhosting modules to set DOCUMENT_ROOT correctly.
- Make mod_vhost_alias set the per-request document root

PR: 26052, 46198, 49705

Remaining tasks:
- Use the context document root & prefix in mod_rewrite to make RewriteBase
  unneccessary in many cases. Do this without breaking compatibility.
- Write docs.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132494 13f79535-47bb-0310-9956-ffa450edef68
2011-06-05 21:33:12 +00:00
93623482e3 - Add <ElseIf> and <Else> to complement <If> sections. These are both easier
to use and more efficient than using several <If> sections.
- Update <If> documentation a bit.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1132469 13f79535-47bb-0310-9956-ffa450edef68
2011-06-05 18:15:02 +00:00
ec52431dde Reorder members in core_dir_config to be more logical and efficient.
MMN bump was already in r1131465


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1131468 13f79535-47bb-0310-9956-ffa450edef68
2011-06-04 19:04:54 +00:00
86d7dd25c4 allow error log formatters to peek at the message format
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1101143 13f79535-47bb-0310-9956-ffa450edef68
2011-05-09 18:43:50 +00:00
bf07c1867c Add new ap_reserve_module_slots/ap_reserve_module_slots_directive API,
necessary if a module (like mod_perl) registers additional modules later than the
EXEC_ON_READ phase.

Tested by: Torsten Foertsch <torsten foertsch gmx net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1096569 13f79535-47bb-0310-9956-ffa450edef68
2011-04-25 19:22:04 +00:00
6bd438fe64 Add in a configuration generation... this is independent of
MPM gen, just in case we ever switch MPMs at a graceful ;)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1087331 13f79535-47bb-0310-9956-ffa450edef68
2011-03-31 15:12:09 +00:00
fdaaf209c5 core: AllowEncodedSlashes new option NoDecode to allow encoded slashes
in request URL path info but not decode them. Change behavior of option
"On" to decode the encoded slashes as 2.0 and 2.2 do.  PR 35256,
PR 46830.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1082196 13f79535-47bb-0310-9956-ffa450edef68
2011-03-16 16:45:25 +00:00
ce73ec0484 spelling fix
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1071794 13f79535-47bb-0310-9956-ffa450edef68
2011-02-17 21:19:16 +00:00
d6de9e9f67 Create new ap_state_query() function that allows modules to determine
if the current configuration run is the initial one at server startup,
and if the server is started for testing/config dumping only.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1070151 13f79535-47bb-0310-9956-ffa450edef68
2011-02-12 21:18:32 +00:00
209d890731 Initialize the core_dir_config->sec_files and ->sec_if only if needed.
This saves some memory and two apr_array_append()s per directory merge.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1060283 13f79535-47bb-0310-9956-ffa450edef68
2011-01-18 09:58:26 +00:00
a38d3c9e23 Merge the <If> sections in a separate step ap_if_walk, after ap_location_walk.
This makes <If> apply to all requests, not only to file base requests and
it allows to use <If> inside <Directory>, <Location>, and <Files> sections.

The merging of <If> sections always happens after the merging of <Location>
sections, even if the <If> section is embedded inside a <Directory> or
<Files> section.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1059867 13f79535-47bb-0310-9956-ffa450edef68
2011-01-17 11:02:38 +00:00
35cdba6976 Replace ap_expr with a parser derived from mod_ssl's parser. Make mod_ssl use
the new parser. Rework ap_expr's public interface and provide hooks for modules
to add variables and functions.

The Netware and Windows build files still need to be adjusted


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1032073 13f79535-47bb-0310-9956-ffa450edef68
2010-11-06 14:31:16 +00:00
8b3bdbc602 improve docs for ap_errorlog_handler and ap_errorlog_info
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1021902 13f79535-47bb-0310-9956-ffa450edef68
2010-10-12 19:59:09 +00:00
b65066c6ac Add generate_log_id hook to allow to use the ID generated by mod_unique_id as
error log ID for requests.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1002125 13f79535-47bb-0310-9956-ffa450edef68
2010-09-28 11:53:17 +00:00
107c5573e1 In ErrorLogFormat, make it possible to log an item only if the loglevel
of the message is higher than a specified value. This allows to achive
the old behaviour for the source file name/line number of being only
logged for debug and higher.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1001381 13f79535-47bb-0310-9956-ffa450edef68
2010-09-26 07:40:15 +00:00
fb36cd8585 add comment about (not) using pools in error log format handlers
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@996306 13f79535-47bb-0310-9956-ffa450edef68
2010-09-12 12:52:48 +00:00
70be0f7a07 Add ErrorLogFormat directive for configuring the error log format, including
additional information that is logged once per connection or request.

Add error log IDs for connections and request to allow correlating error log
lines and the corresponding access log entry.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@992806 13f79535-47bb-0310-9956-ffa450edef68
2010-09-05 15:44:19 +00:00
a0e0e585b0 Disable sendfile by default, as discussed at
http://mail-archives.apache.org/mod_mbox/httpd-dev/201007.mbox/<4C4355EE.2060605@rowe-clan.net>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@992689 13f79535-47bb-0310-9956-ffa450edef68
2010-09-04 21:53:06 +00:00
ec0051094a Move AddOutputFilterByType implementation from core to mod_filter.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@966869 13f79535-47bb-0310-9956-ffa450edef68
2010-07-22 21:54:39 +00:00
ed451e94d1 re-order many struct members for better alignment on 64bit
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@959464 13f79535-47bb-0310-9956-ffa450edef68
2010-06-30 22:34:05 +00:00
2334a1ea4f - Add loglevels to request_rec and conn_rec
- Introduce per-directory loglevel configuration


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951897 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 17:04:40 +00:00
4a3208e16a Remove loglevel entry in core_dir_config, which has been unused for at
least some years.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951191 13f79535-47bb-0310-9956-ffa450edef68
2010-06-03 22:51:45 +00:00
3560f2e015 Turn static function get_server_name_for_url() into public function
ap_get_server_name_for_url() and use it where appropriate. This fixes
mod_rewrite generating invalid URLs for redirects to IPv6 literal addresses.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@900022 13f79535-47bb-0310-9956-ffa450edef68
2010-01-16 20:32:09 +00:00
92023763f1 mod_logio: introduce new optional function ap_logio_get_last_bytes to get
total byte count of last request.

core: Use ap_logio_get_last_bytes to report more accurate byte counts in
mod_status if mod_logio is loaded. Without mod_logio, don't increment
counts for HEAD requests.

PR: 25656


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@823337 13f79535-47bb-0310-9956-ffa450edef68
2009-10-08 21:42:13 +00:00
489bc420dd Security fix for CVE-2009-1195: fix Options handling such that
'AllowOverride Options=IncludesNoExec' does not permit Includes with
exec= enabled to be configured in an .htaccess file:

* include/http_core.h: Change semantics of Includes/IncludeNoExec
  options bits to be additive; OPT_INCLUDES now means SSI is enabled
  without exec=.  OPT_INCLUDES|OPT_INC_WITH_EXEC means SSI is enabled
  with exec=.

* server/core.c (create_core_dir_config): Remove defunct OPT_INCNOEXEC
  from default override_opts; no functional change.
  (merge_core_dir_configs): Update logic to ensure that exec= is
  disabled in a context where IncludesNoexec is configured, even if
  Includes-with-exec is permitted in the inherited options set.
  (set_allow_opts, set_options): Update to reflect new semantics
  of OPT_INCLUDES, OPT_INC_WITH_EXEC.

* server/config.c: Update to remove OPT_INCNOEXEC from default 
  override_opts; no functional change.

* modules/filters/mod_include.c (includes_filter): Update to reflect
  new options semantics - disable exec= support if the
  OPT_INC_WITH_EXEC bit is not set.

Submitted by: Jonathan Peatfield <j.s.peatfield damtp.cam.ac.uk>,
          jorton
Thanks to: Vincent Danon <vdanon redhat.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@772997 13f79535-47bb-0310-9956-ffa450edef68
2009-05-08 14:13:15 +00:00
421ee8b008 Disabled DefaultType directive and removed ap_default_type()
from core.  We now exclude Content-Type from responses for which
a media type has not been configured via mime.types, AddType,
ForceType, or some other mechanism.  MMN major bump to NZ time.

PR: 13986



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@739382 13f79535-47bb-0310-9956-ffa450edef68
2009-01-30 19:12:51 +00:00
05e6cb18a1 bollocks, it's absolute crap to break the ABI structure alignment for features
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@731068 13f79535-47bb-0310-9956-ffa450edef68
2009-01-03 19:20:26 +00:00
1643f818ae * include/http_core.h
(core_dir_config): Fix warning: overflow in implicit constant conversion,
    generated by core.c line 117, which sets content_md5 to '2', which is too big
    for a signed value -- but it looks like this was really meant to be unsigned.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@708828 13f79535-47bb-0310-9956-ffa450edef68
2008-10-29 08:39:26 +00:00
819e174356 Include http_config.h from http_core, since now without CORE_PRIVATE, you need
the definition for the module type.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645432 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 09:52:18 +00:00
5e415009f3 Remove CORE_PRIVATE.
This define serves no modern purpose, since every module in the wild, including 
our own define it, for no purpose.

If you have functions which you do not want in the 'public' API, put them
in a private header, that is not installed, just like mod_ssl does.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645412 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 08:44:14 +00:00
774f43485c HTTPD Core: Implement <If> sections for conditional (runtime) configuration.
N.B. This is a first pass, and has a way to go!


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@644253 13f79535-47bb-0310-9956-ffa450edef68
2008-04-03 10:23:12 +00:00
d300b0e287 *) mod_logio: Provide optional function to allow modules to adjust the
bytes_in count [Eric Covener]

Practical example: alternate SSL implementation that lives 
beyond the filters (IOL)



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@611199 13f79535-47bb-0310-9956-ffa450edef68
2008-01-11 15:07:53 +00:00
2874d54f16 re-introduce ap_satisfies API back into core and modify how the access_checker, check_user_id and auth_checker hooks are called so that they respect the precedence that is set through the satisfy ALL/ANY directive. This also restores the directives order, allow, deny, satisfyas supported directives rather than being deprecated. These directives still remain in mod_access_compat however.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@534533 13f79535-47bb-0310-9956-ffa450edef68
2007-05-02 16:31:39 +00:00
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
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
9fed4c73d7 Authz refactoring
Merge from branches/authz-dev

Basically here is a list of what has been done:
- Convert all of the authz modules from hook based to provider based
- Remove the ap_requires field from the core_dir_config structure
- Remove the function ap_requires() since its functionality is no
longer supported or necessary in the refactoring
- Remove the calls to ap_some_auth_required() in the core request
handling to allow the  hooks to be called in all cases.
- Add the new module mod_authz_core which will act as the authorization
provider vector and contain common authz directives such as 'Require',
'Reject' and  '<RequireAlias>'
- Add the new module mod_authn_core which will contain common
authentication directives such as 'AuthType', 'AuthName' and
'<AuthnProviderAlias>'
- Move the check for METHOD_MASK out of the authz providers and into
the authz_core provider vector
- Define the status codes that can be returned by the authz providers
as AUTHZ_DENIED,  AUTHZ_GRANTED and AUTHZ_GENERAL_ERROR   
- Remove the 'Satisfy' directive 
- Implement the '<RequireAll>', '<RequireOne>' block directives  to
handle the 'and' and 'or' logic for authorization.
- Remove the 'AuthzXXXAuthoritative' directives from all of the authz
providers
- Implement the 'Reject' directive that will deny authorization if the
argument is true
- Fold the 'Reject' directive into the '<RequireAll>', '<RequireOne>'
logic
- Reimplement the host based authorization functionality provided by 
'allow', 'deny' and 'order' as authz providers   
- Remove the 'allow', 'deny' and 'order' directives      
- Merge mod_authn_alias into mod_authn_core
- Add '<RequireAlias>' functionality which is similar to
'<AuthnProviderAlias>' but specific to authorization aliasing
- Remove all of the references to the 'authzxxxAuthoritative'
directives from the documentation
- Remove the 'Satisfy' directive from the documentation
- Remove 'Allow', 'Deny', 'Order' directives from the documentation
- Document '<RequireAll>', '<RequireOne>', 'Reject' directives
- Reimplement the APIs ap_auth_type(), ap_auth_name() as optional
functions and move the  actual implementation into mod_authn_core
- Reimplement the API ap_some_auth_required() as an optional function
and move the  actual implementation into mod_authz_core

Major Changes:
- Added the directives <RequireAll>, <RequireOne>, <RequireAlias>,
Reject
- Expanded the functionality of the directive 'Require' to handle all
authorization and access control
- Added the new authz providers 'env', 'ip', 'host', 'all' to handle
host-based access control
- Removed the directives 'Allow', 'Deny', 'Order', 'Satisfy',
'AuthzXXXAuthoritative'
- Removed the ap_require() API
- Moved the directives 'AuthType', 'AuthName' out of mod_core and into
mod_authn_core
- Moved the directive 'Require' out of mod_core and into
mod_authz_core
- Merged mod_authn_alias into mod_authn_core
- Renamed mod_authz_dbm authz providers from 'group' and 'file-group'
to 'dbm-group' and 'dbm-file-group'

Benefits:
- All authorization and access control is now handle through two
directives, 'Require' and 'Reject'
- Authorization has been expanded to allow for complex 'AND/OR' control
logic through the directives '<RequireAll>' and '<RequireOne>'
- Configuration is now much simpler and consistent across the board
- Other modules like mod_ssl and mod_proxy should be able to plug into
and take advantage of  the same provider based authorization mechanism
by implementing their own providers

Issues:
- Backwards compatibility between 2.2 and 2.3 configurations will be
broken in the area  of authorization and access control due to the fact
that the directives 'allow', 'deny',  'order' and 'satisfy' have been
removed.  When moving from 2.2 to 2.3 these directives  will have to be
changed to 'Require all granted', 'Require all denied' or some variation
 of the authz host-based providers.
- Existing third party authorization modules will have to adapt to the
new structure.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@368027 13f79535-47bb-0310-9956-ffa450edef68
2006-01-11 14:30:28 +00:00
b7575cf6ac Okay, at least be nice when "breaking" the API.
Tuck the new bitfield to the tail and adjust the
MMN


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@344384 13f79535-47bb-0310-9956-ffa450edef68
2005-11-15 15:58:57 +00:00
ce503e00e3 Add in the UseCanonicalPhysicalPort directive, which
basically allows Apache to configurably ( :) )
use the physical port when constructing the
canonical port. Also add the exact ordering to
the docs, so people can easily see how it works.
We now have compatibility with both 2.0 and 1.3.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@344369 13f79535-47bb-0310-9956-ffa450edef68
2005-11-15 14:50:39 +00:00
7e2a5490d1 NET_TIME, as a standalone feature, was a horrid idea.
The core filter will NOT operate correctly across platforms 
  (even between Linux/Solaris) without setting up the conn->timeout,
  so always apply the timeout when establishing the core filter.

  The keep-alive-timeout is entirely an HTTP-ism, and needs to
  move to the http protocol handler.  Note #1; this isn't triggered
  in the event mpm, but the event mpm introspects s->keep_alive_timeout
  directly adding it to the pollset, so this is a non-sequitor.

  Finally, once the headers are read, the named virtual host may
  have a different (more/less permissive) timeout for the remainder
  of the request body.  This http-centric patch picks up that subtle
  detail and can switch to a named-vhost timeout.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@306495 13f79535-47bb-0310-9956-ffa450edef68
2005-10-06 01:29:42 +00:00
8c1e315d3f Doxygen fixup / cleanup
submited by: Neale Ranns neale ranns.org
reviewed by: Ian Holsman



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@263931 13f79535-47bb-0310-9956-ffa450edef68
2005-08-28 23:03:59 +00:00
025c799a79 Initially a no-op. Add trace_enable configuration. The http and proxy
flavors of interpreting this flag are yet to be committed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@208785 13f79535-47bb-0310-9956-ffa450edef68
2005-07-01 19:39:26 +00:00
6a23d6ebeb Merge the listen-protocol sandbox branch to trunk.
I will be adding documentation for the new directives hopefully in the next day or so.

* server/core.c: Added 'Protocol' to the core module config
                 Added ap_{set,get}_server_protocol API.
                 Added new directive: 'AcceptFilter'.
                 Enable 'httpready' by default on systems that support it.  Use dataready filters for others.

* server/listen.c: Attempt to inherit protocols from Listener Records to Server configs.
                   The 'Listen' directive can now optionally take a protocol arg
                   Move bits that determined which accept filter is applied to core.c.
                   Added bits to find the correct accept filter based on the core's configuration.

* include/{ap_listen.h,http_core.h}: Add Protocol to respective structures.

* include/http_core.h: Add the accf_map table to the core_server_config structure

* include/ap_mmn.h: Minor MMN Bump for the new interfacces.

* modules/ssl/ssl_engine_init.c: Use the new protocol framework to enable mod_ssl for 'https' websites.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@190563 13f79535-47bb-0310-9956-ffa450edef68
2005-06-14 09:21:18 +00:00