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

191 Commits

Author SHA1 Message Date
Eric Covener
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
Eric Covener
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
Stefan Fritsch
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
Jeff Trawick
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
Stefan Fritsch
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
Nick Kew
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
Stefan Fritsch
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
Stefan Fritsch
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
Stefan Fritsch
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
Stefan Fritsch
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
Stefan Fritsch
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
Stefan Fritsch
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
Stefan Fritsch
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
Takashi Sato
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
Brian Havard
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
Jeff Trawick
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
Paul Querna
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
Chris Darroch
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
Chris Darroch
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
Graham Leggett
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
Graham Leggett
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
Paul Querna
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
Martin Kraemer
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
Chris Darroch
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
Nick Kew
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
Ruediger Pluem
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
Nick Kew
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
Graham Leggett
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
Nick Kew
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
Nick Kew
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
Bradley Nicholes
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
Sander Temme
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
Nick Kew
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
Ruediger Pluem
36ca0ac794 * If APR_FINFO_NAME is added to the list of wanted information, apr_stat
always returns APR_INCOMPLETE on Unix platforms in the case that the
  call to the native stat / lstat did not fail. So we can safely assume
  that the stat / lstat call has been successful in this case.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@491297 13f79535-47bb-0310-9956-ffa450edef68
2006-12-30 20:07:14 +00:00
Paul Querna
4794b34ea9 Improve the error message, include the full path of the file we are actually trying to call stat on.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@490920 13f79535-47bb-0310-9956-ffa450edef68
2006-12-29 05:27:49 +00:00
Ruediger Pluem
0255874634 * Although the lstat call should rarely ever fail, because we stat'ed the
same file several lines above, check the return value to be save that
  nothing bad happens in the case it does fail.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@425394 13f79535-47bb-0310-9956-ffa450edef68
2006-07-25 13:40:32 +00:00
Ruediger Pluem
f1c497a222 * Fix typo. No functional change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@425057 13f79535-47bb-0310-9956-ffa450edef68
2006-07-24 14:09:27 +00:00
Ruediger Pluem
356d882a5d * Check for symbolic links of the target file in the optimized case that we
had already done this specific directory walk for this request. This can
  happen when we have an internal redirect, like the ones caused by mod_dir
  (/ -> index.html). See also

  http://mail-archives.apache.org/mod_mbox/httpd-dev/200607.mbox/%3c44B5521F.8050906@globalvanet.com%3e

Reviewed by: wrowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@423886 13f79535-47bb-0310-9956-ffa450edef68
2006-07-20 11:01:07 +00:00
Roy T. Fielding
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
Colm MacCarthaigh
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
Garrett Rooney
668a5863a7 Make some error checking more clear by using the defined constants instead
of literal values.

Patch by: Dan Rall <dlr apache.org>

* server/request.c
  (ap_process_request_internal): Check the return value of hook functions
   against the constant OK instead of the magic number 0 to improve clarity.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@368505 13f79535-47bb-0310-9956-ffa450edef68
2006-01-12 22:51:00 +00:00
Bradley Nicholes
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
Jim Jagielski
5061d9fa92 No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:11:44 +00:00
Jim Jagielski
5d2fae4818 No functional change: simple detabbing of indented code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332305 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:05:51 +00:00
William A. Rowe Jr
62d58df5ca Pay close attention to core_create_req() ... and note
that not one other member of the r->vars is initialized
  herein.  Move this initialization elsewhere.

  (If this is the 'default' - it really aught to be the
  zero value, for that matter).



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@295141 13f79535-47bb-0310-9956-ffa450edef68
2005-10-05 23:37:53 +00:00
Colm MacCarthaigh
05c9c13006 Initialise a variable, to avoid a gcc warning.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@293364 13f79535-47bb-0310-9956-ffa450edef68
2005-10-03 15:14:13 +00:00
Colm MacCarthaigh
f2bcdddae0 When doing a subrequest lookup, do not lookup using the quickhandler if
next_filter is NULL, since this implies that the subrequest will be
internal_fast_redirect'ed or will never be called. See line request.c:1513
onwards (in make_sub_request) also.  


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@291914 13f79535-47bb-0310-9956-ffa450edef68
2005-09-27 11:52:14 +00:00
Joe Orton
9b6e07b561 * server/request.c (core_opts_merge): When AllowOverride is specified
for the directory, ignore the inherited override_opts field.

PR: 35330
Submitted by: kabe <kabe sra-tohoku.co.jp>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@291120 13f79535-47bb-0310-9956-ffa450edef68
2005-09-23 14:11:18 +00:00
Joshua Slive
f154e2b3b2 Any failure in apr_stat on a symlink currently gives
"Symbolic link not allowed", which results in much head-scratching
if the actual problem is a broken link of some sort.  The real
fix would be to propogate the correct apr_stat error into the
error log, but that would require more refactoring than I'm
prepared to do.  This change simply expands the error message
to include both possibilities.  It improves the situation for
PR28515 but does not solve it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@280018 13f79535-47bb-0310-9956-ffa450edef68
2005-09-10 16:36:37 +00:00
Ian Holsman
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