Commit Graph

208 Commits

Author SHA1 Message Date
c5ce231c30 add filesystem paths to some common error messages.
(slightly modified from dev@ post to not bury the "failed/denied")



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1301504 13f79535-47bb-0310-9956-ffa450edef68
2012-03-16 13:38:07 +00:00
2aa21a62b1 Clean up size_t abuse, part 2. ap_malloc/calloc/realloc are explicitly
excluded from this cleanup as they must be signature identical to the
clib functions, and although the definition of size_t has been flakey,
the definition of those functions appears to be generally clean since
ANSI C.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1228323 13f79535-47bb-0310-9956-ffa450edef68
2012-01-06 18:15:08 +00:00
ad489c105b Further clarify the naming of the entity that originates the request by
calling that entity a useragent instead of a client.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1214005 13f79535-47bb-0310-9956-ffa450edef68
2011-12-14 00:33:46 +00:00
92e366007c Add lots of unique tags to error log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
2011-12-02 23:02:04 +00:00
394e5594d6 Introduce a per connection "peer_ip" and a per request "client_ip" to
distinguish between the raw IP address of the connection and the effective
IP address of the request.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1206291 13f79535-47bb-0310-9956-ffa450edef68
2011-11-25 19:42:04 +00:00
4ee7eea4cf Introduce a per request version of the remote IP address, which can be
optionally modified by a module when the effective IP of the client
is not the same as the real IP of the client (such as a load balancer).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204968 13f79535-47bb-0310-9956-ffa450edef68
2011-11-22 13:10:39 +00:00
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
427c85bd23 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@1174751 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:39:32 +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
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
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
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
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
774529eb10 Save a useless check:
ap_get_request_note() cannot fail unless there is a bug somewhere and if
prep_walk_cache() returned NULL, we would just segfault later on.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1057920 13f79535-47bb-0310-9956-ffa450edef68
2011-01-11 23:10:06 +00:00
6ef1911acc ap_expr related fixes/enhancements:
- implement regex backreferences and make them available for setting 
  envvars in SetEnvIfExpr
- implement nested function calls in %-syntax: %{func1:%{func2:arg}} 
- actually implement evaluation of concatenation operator (oops...)
- Fix <If ... > treating an internal error as success


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1037504 13f79535-47bb-0310-9956-ffa450edef68
2010-11-21 17:22:26 +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
749058def7 PR#45722: if we get EACCESS in the directory walk, give the hint that's in 1.3
about search permissions on intermediate directories.  I left the prefix of the message 
as "denied" instead of "failed" to satisfy web searches.


The extended error text was added to 1.3.x but not trunk in 
  http://svn.apache.org/viewvc?view=revision&revision=99781

This plagues users on IRC!



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1031307 13f79535-47bb-0310-9956-ffa450edef68
2010-11-04 22:36:37 +00:00
579ab22775 PR49809: Allow DirectoryMatch to match the EOL character ($). and
stop applying to subdirectories (that don't also match the regex) implicitly.  

The manual already uses DirectoryMatch syntax that assumes this in other places!



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@990091 13f79535-47bb-0310-9956-ffa450edef68
2010-08-27 10:46:02 +00:00
a8b19fb99f Add the same r->user == NULL check in the Satisfy Any code path as r965709 did
for Satisfy all


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@986606 13f79535-47bb-0310-9956-ffa450edef68
2010-08-18 09:24:04 +00:00
0ce133f8a8 Intel's compiler warns about assigning the non-enum value 0 to the
enumeration apr_finfo_t.filetype, which is done when forgetting
the previously-derived file type

use the appropriate enum value APR_NOFILE instead

Also change comparisons of the field with 0 to use APR_NOFILE instead,
as is the practice of some existing code.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@983065 13f79535-47bb-0310-9956-ffa450edef68
2010-08-06 17:36:52 +00:00
a527986832 remove more unused variables
revove some obsolete comments

netware file is untested


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982050 13f79535-47bb-0310-9956-ffa450edef68
2010-08-03 22:12:19 +00:00
f5dc2a1177 Don't risk segfault in authz if r->user is not set
PR 42995


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@965709 13f79535-47bb-0310-9956-ffa450edef68
2010-07-20 01:34:39 +00:00
b24bd5dcbe fix log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@964161 13f79535-47bb-0310-9956-ffa450edef68
2010-07-14 20:03:42 +00:00
f14218c7ad The approach for allowing authorization by user or IP introduced in r956387,
etc. causes problems because the authentication module calls
note_*_auth_failure if authentication fails. This is inappropriate if access is
later allowed because of the IP.

So, instead of calling the auth_checker hook even if authentication failed, we
introduce a new access_checker_ex hook that runs between the access_checker and
the check_user_id hooks. If an access_checker_ex functions returns OK, the
request will be allowed without authentication.

To make use of this, change mod_authz_core to walk the require blocks in the
access_checker_ex phase and deny/allow the request if the authz result does not
depend on an authenticated user. To distinguish a real AUTHZ_DENIED from an
authz provider from an authz provider needing an authenticated user, the latter
must return the new AUTHZ_DENIED_NO_USER code.



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@964156 13f79535-47bb-0310-9956-ffa450edef68
2010-07-14 19:59:31 +00:00
9cc65ede67 Don't restore r->user after authn/authz failure. Any authn module that sets
r->user even if authentication failed is broken, anyway.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@956395 13f79535-47bb-0310-9956-ffa450edef68
2010-06-20 19:46:54 +00:00
b561de7094 Fix authorization by user or IP/ENV/...
Note ap_note_auth_failure() breakage in STATUS


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@956387 13f79535-47bb-0310-9956-ffa450edef68
2010-06-20 19:15:01 +00:00
b7936c98ba More trace logging
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@956374 13f79535-47bb-0310-9956-ffa450edef68
2010-06-20 16:17:23 +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
ebb62867fb Use the new APLOG_USE_MODULE/AP_DECLARE_MODULE macros everywhere to take
advantage of per-module loglevels


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951895 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:59:50 +00:00
0534f5f339 Fix string constness to get rid of gcc compiler warnings by -Wwrite-strings.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@894368 13f79535-47bb-0310-9956-ffa450edef68
2009-12-29 12:34:26 +00:00
60fbe11de1 Bring back OS/2 support.
Reverses r758929 with a little bit of conflict resolution.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@807930 13f79535-47bb-0310-9956-ffa450edef68
2009-08-26 08:56:13 +00:00
ee32468a33 remove OS/2 platform support
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@758929 13f79535-47bb-0310-9956-ffa450edef68
2009-03-26 23:47:52 +00:00
a73acf02f6 API Cleanup in preperation for 2.4.x, make sure all exported functions or variables contain an ap_ prefix.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@722399 13f79535-47bb-0310-9956-ffa450edef68
2008-12-02 08:13:36 +00:00
fc21f4e72e Determine registered authn/z providers directly in ap_setup_auth_internal(),
which allows optional functions that just wrapped ap_list_provider_names()
to be removed from authn/z modules.

This change requires modules/aaa/mod_auth.h to be included into
server/request.c, which necessitates a minor change to configure.in for
Unix platforms.

I'm unable to tell whether a similar change is necessary for Windows and
NetWare builds or not.  Could developers with access to those platforms
please test and make any needed configuration or build alterations?  Thanks!


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@659160 13f79535-47bb-0310-9956-ffa450edef68
2008-05-22 17:01:14 +00:00
ff9487248a When testing for slash-terminated configuration paths in
ap_location_walk(), don't look past the start of an empty string
such as that created by a <Location ""> directive.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@654998 13f79535-47bb-0310-9956-ffa450edef68
2008-05-10 00:49:03 +00:00
3381ababb9 mod_request: Insert the KEPT_BODY filter via the insert_filter
hook instead of during fixups. Add a safety check to ensure the
filters cannot be inserted more than once. [Graham Leggett,
Ruediger Pluem]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@654952 13f79535-47bb-0310-9956-ffa450edef68
2008-05-09 21:59:02 +00:00
b613588a30 Move the KeptBodySize directive, kept_body filters and the
ap_parse_request_body function out of the http module and into a
new module called mod_request, reducing the size of the core.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@647263 13f79535-47bb-0310-9956-ffa450edef68
2008-04-11 18:41:53 +00:00
a324a1d72f Remove all references to CORE_PRIVATE.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645455 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 10:45:43 +00:00
efe851a186 Make it compile on pre-C99 compilers (Move decls to beginning of func)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645395 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 06:28:50 +00:00
c8ba67fb83 Avoid calling access control hooks for internal requests with
configurations which match those of the initial request.  Revert to
the original behaviour (call access control hooks for internal requests
with URIs different from the initial request) if any access control hooks
or providers are not registered as permitting this optimization.
Introduce wrappers for access control hook and provider registration
which can accept additional mode and flag data.

The configuration walk optimizations were originally proposed a while
ago (see http://marc.info/?l=apache-httpd-dev&m=116536713506234&w=2);
they have been used since then in production systems and appear to be
stable and effective.  They permit certain combinations of modules
and clients to function efficiently, especially when a deeply recursive
series of internal requests, such as those generated by certain WebDAV
requests, are all subject to the identical authentication and authorization
directives.

The major change from the original proposal is a cleaner mechanism for
detecting modules which may expect the old behaviour.  This has been
tested successfully with Subversion's mod_authz_svn, which specifically
requires the old behaviour when performing path-based authorization based
against its own private access control configuration files.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@644525 13f79535-47bb-0310-9956-ffa450edef68
2008-04-03 21:51:07 +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
26c1757521 * lfi is already a pointer in contrast fi which was used before.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@633174 13f79535-47bb-0310-9956-ffa450edef68
2008-03-03 17:02:19 +00:00
4a70c39c49 core: fix SymlinksIfOwnerMatch checking:
(1) Fix Origin checking (PR 36783 - Robert L Mathews)
  (2) Check ownership if both FollowSymlinks and SymlinksIfOwnerMatch are set


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@632947 13f79535-47bb-0310-9956-ffa450edef68
2008-03-03 06:13:59 +00:00
a6d30e317a core: Add the option to keep aside a request body up to a certain
size that would otherwise be discarded, to be consumed by filters
such as mod_include. When enabled for a directory, POST requests
to shtml files can be passed through to embedded scripts as POST
requests, rather being downgraded to GET requests.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@592951 13f79535-47bb-0310-9956-ffa450edef68
2007-11-07 23:31:03 +00:00
4d815c29d1 Reinstate location walk for subrequests
PR 41960 (Jose Kahan)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@579664 13f79535-47bb-0310-9956-ffa450edef68
2007-09-26 14:26:19 +00:00
e5061abc93 Multiple trivial fixes from Christophe JAILLET
PR 38699, 39518, 42005, 42006, 42007, 42008, 42009
The patches are all his, and are sufficiently trivial to review
at a glance.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@557837 13f79535-47bb-0310-9956-ffa450edef68
2007-07-20 01:26:55 +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
8aaea15506 Detab
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@522084 13f79535-47bb-0310-9956-ffa450edef68
2007-03-24 18:22:35 +00:00
8da719ecea PR#41829 - Torsten Förtsch
Fix uninitialised var in server/request.c


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@522011 13f79535-47bb-0310-9956-ffa450edef68
2007-03-24 12:58:40 +00:00