1
0
mirror of https://github.com/apache/httpd.git synced 2025-11-06 16:49:32 +03:00
Commit Graph

51 Commits

Author SHA1 Message Date
Stefan Fritsch
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
Stefan Fritsch
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
Jim Jagielski
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
Stefan Fritsch
46d4791a5d Add string valued expressions to ap_expr, do some API cleanup
- add possibility to have expressions that evaluate to a string and not to
  a boolean value
- modify ap_expr_parse_cmd() interface to support this and make it more
  convenient to use in general
- rename AP_EXPR_FLAGS_* to AP_EXPR_FLAG_* for consistency


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1142164 13f79535-47bb-0310-9956-ffa450edef68
2011-07-02 07:45:00 +00:00
Stefan Fritsch
a26647d823 Don't log AuthMerging XXX as <RequireXXX>
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1056717 13f79535-47bb-0310-9956-ffa450edef68
2011-01-08 14:37:09 +00:00
Stefan Fritsch
4545ed5fcc Fix a bug in authz logic merging which caused
section->op == AUTHZ_LOGIC_AND
        auth_result == AUTHZ_DENIED_NO_USER
        child_result == AUTHZ_GRANTED
to return AUTHZ_GRANTED instead of AUTHZ_DENIED_NO_USER.

While there, refactor the if blocks to make them a bit more readable.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1056713 13f79535-47bb-0310-9956-ffa450edef68
2011-01-08 14:29:12 +00:00
Stefan Fritsch
b196fbc491 Remove obsolete and redundant log message in env auth provider
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1054014 13f79535-47bb-0310-9956-ffa450edef68
2010-12-30 22:38:30 +00:00
Stefan Fritsch
e4603be7f5 Add new AuthzSendForbiddenOnFailure directive to allow sending '403 FORBIDDEN'
instead of '401 UNAUTHORIZED' if authorization fails for an authenticated user

PR: 40721


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1050677 13f79535-47bb-0310-9956-ffa450edef68
2010-12-18 17:11:14 +00:00
Stefan Fritsch
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
Stefan Fritsch
c40fa87ce7 Log errors/infos during expression evaluation and associate the message
with the module that is calling ap_expr_exec()


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1037140 13f79535-47bb-0310-9956-ffa450edef68
2010-11-20 08:59:50 +00:00
Stefan Fritsch
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
Stefan Fritsch
00f70ddc9a more temp pool usage and remove some useless apr_pstrdup()s
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1026660 13f79535-47bb-0310-9956-ffa450edef68
2010-10-23 18:35:06 +00:00
Stefan Fritsch
a10a4e4f2f This is just too easy to not do it: Add an 'expr' authz provider that allows
arbitrary expressions in Require lines.

The main issue I wanted to fix was that the env provider only allows to
check for the existance of an envvar but not the contents.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1002363 13f79535-47bb-0310-9956-ffa450edef68
2010-09-28 21:33:44 +00:00
Stefan Fritsch
3ecb593365 Move all, env, and method authz providers from mod_authz_host to mod_authz_core
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1001200 13f79535-47bb-0310-9956-ffa450edef68
2010-09-25 12:01:14 +00:00
Stefan Fritsch
1008c27260 Allow authz providers to check args while reading the config and allow
them to cache parsed args.

Use this to check that argument to 'all' provider is 'granted' or 'denied'.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@998706 13f79535-47bb-0310-9956-ffa450edef68
2010-09-19 17:55:47 +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
eedf130332 Introduce note_auth_failure hook to allow modules to add support
for additional auth types. This makes ap_note_auth_failure() work with
mod_auth_digest again.

PR: 48807


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@960399 13f79535-47bb-0310-9956-ffa450edef68
2010-07-04 21:16:53 +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
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
Jeff Trawick
052afc6560 "fix" this warning by passing "%s" as the format string:
mod_authz_core.c: In function ‘authz_core_check_section’:
mod_authz_core.c:579: warning: format not a string literal and no format arguments


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@775460 13f79535-47bb-0310-9956-ffa450edef68
2009-05-16 13:21:23 +00:00
Chris Darroch
c4c31dd463 Per suggestions by Roy T. Fielding:
- remove Match directive, allow Require to be negated
 - rename <Match*> directives to <Require*>
 - rename <RequireNotAny> to <RequireNone>
 - disable <RequireNotAll>
 - rename MergeAuthz to AuthMerging and change its arguments to Off|And|Or

Also convert text formatting macros into functions, and revise
authz_core_check_section() so that check for non-negative directives
follows De Morgan optimization.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@726082 13f79535-47bb-0310-9956-ffa450edef68
2008-12-12 18:25:17 +00:00
Chris Darroch
85e7288fb5 whitespace cleanup
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@724813 13f79535-47bb-0310-9956-ffa450edef68
2008-12-09 18:40:18 +00:00
Ruediger Pluem
4ca264abc8 * Better use calloc instead of alloc to initialize unset fields in struct.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709881 13f79535-47bb-0310-9956-ffa450edef68
2008-11-02 13:38:11 +00:00
Chris Darroch
fa0fdfa2fc Fix handling of authz configurations, make default authz logic replicate
2.2.x authz logic and support existing configurations (including .htaccess
files), and replace <Satisfy*>, Reject, and AuthzMergeRules directives
with Match, <Match*>, and AuthzMerge directives.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709838 13f79535-47bb-0310-9956-ffa450edef68
2008-11-02 04:01:32 +00:00
Chris Darroch
54a737b120 minor formatting changes prior to larger changes
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709754 13f79535-47bb-0310-9956-ffa450edef68
2008-11-01 19:03:56 +00:00
Chris Darroch
8fee2005b0 remove unused variables, rename some variables, move and change
variable initializations, etc., prior to larger changes


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709751 13f79535-47bb-0310-9956-ffa450edef68
2008-11-01 18:58:49 +00:00
Chris Darroch
6bfd10b3d9 prevent crash when authz provider not registered prior to use in alias
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709746 13f79535-47bb-0310-9956-ffa450edef68
2008-11-01 18:28:17 +00:00
Chris Darroch
99b3df75de move some variable initializations prior to larger changes
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709742 13f79535-47bb-0310-9956-ffa450edef68
2008-11-01 18:22:55 +00:00
Chris Darroch
a7e48ffbbb localize some variables in authz provider alias functions
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709736 13f79535-47bb-0310-9956-ffa450edef68
2008-11-01 17:58:19 +00:00
Chris Darroch
8564ca3ee9 move function prior to larger changes
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709728 13f79535-47bb-0310-9956-ffa450edef68
2008-11-01 17:24:57 +00:00
Chris Darroch
44de43a894 remove trailing whitespace, adjust formatting and comments prior
to larger changes


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@709705 13f79535-47bb-0310-9956-ffa450edef68
2008-11-01 14:50:30 +00:00
Bradley Nicholes
47f3698bf3 Switch the default base authz logic operation to 'AND' rather than 'OR'. This should allow directory authz rules merging to be more restrictive in sub-directories
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@667651 13f79535-47bb-0310-9956-ffa450edef68
2008-06-13 20:59:10 +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
9864958fcd Convert common provider version strings ("0") to
AUTHN/Z_PROVIDER_VERSION macros defined in mod_auth.h.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@658046 13f79535-47bb-0310-9956-ffa450edef68
2008-05-19 23:53:05 +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
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
286110c493 Fix clash between r557837 and r427780
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@557972 13f79535-47bb-0310-9956-ffa450edef68
2007-07-20 11:56:36 +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
Jeff Trawick
0082457202 log the uri for some access-denied paths when r->filename is
unset


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@529626 13f79535-47bb-0310-9956-ffa450edef68
2007-04-17 14:36:12 +00:00
Bradley Nicholes
7159a46f37 revert the reject directive is definitive patch and normalize the logic lists.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@428798 13f79535-47bb-0310-9956-ffa450edef68
2006-08-04 17:53:27 +00:00
Bradley Nicholes
6b831e7059 Converted the reject directive to be definitive and enabled directory_merge to merge all of the authorization rules and logic.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@427780 13f79535-47bb-0310-9956-ffa450edef68
2006-08-01 22:54:38 +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
292e59fa35 Clean up some stuff found by Coverity.
* modules/aaa/mod_authz_core.c
  (check_provider_list): Remove redundant code.
* modules/aaa/mod_auth.h
  (AUTHZ_DEFAULT_PROVIDER): Remove redundant definition.

Submitted by: Max Bowsher <maxb apache.org>
Reviewed by: bnicholes, rooneg


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@390506 13f79535-47bb-0310-9956-ffa450edef68
2006-03-31 21:35:44 +00:00
David Reid
91ac51bebd - tidy up some of the comments and make the file more readable
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@378400 13f79535-47bb-0310-9956-ffa450edef68
2006-02-17 00:04:05 +00:00
Joe Orton
4bd562595a * modules/aaa/mod_authz_core.c (add_authz_provider): Fix pointer cast
warning on LP64 platforms.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@375549 13f79535-47bb-0310-9956-ffa450edef68
2006-02-07 08:53:37 +00:00
Bradley Nicholes
0a7d8b69dd eliminate the import of the ap_satisfies optional function on every request. Just import it once if it exists.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@369124 13f79535-47bb-0310-9956-ffa450edef68
2006-01-15 00:26:20 +00:00
Bradley Nicholes
cea551d1fe clean up some left-over debugging code and comments
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@368978 13f79535-47bb-0310-9956-ffa450edef68
2006-01-14 05:06:39 +00:00
Bradley Nicholes
9b7b82922a Restore Order, Deny, Allow, Satisfy for backwards compatibility with authz
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@368929 13f79535-47bb-0310-9956-ffa450edef68
2006-01-14 00:13:22 +00:00