28#define APR_WANT_STRFUNC
29#define APR_WANT_BYTEFUNC
44#if APR_HAVE_NETINET_IN_H
45#include <netinet/in.h>
48#undef AUTHZ_EXTRA_CONFIGS
98module AP_MODULE_DECLARE_DATA authz_core_module;
128 !(
base->section ||
new->section)) {
139 base->section->limited |
new->section->limited;
145 sizeof(*
base->section));
147 sizeof(*
new->section));
150 sizeof(*
base->section));
163 if (
new->authz_forbidden_on_fail ==
UNSET)
195 const char *provider_name;
236 "no alias provider found for '%s' (BUG?)",
237 provider_name ? provider_name :
"n/a");
253 char *provider_alias;
266 "> directive missing closing '>'",
NULL);
273 "> directive requires additional arguments",
NULL);
282 if (!provider_name[0] || !provider_alias[0]) {
284 "> directive requires additional arguments",
NULL);
291 "When several arguments (%s %s...) are passed to a %s directive, "
292 "they must be enclosed in quotation marks. Otherwise, only the "
293 "first one is taken into account",
329 "Unknown Authz provider: %s",
337 "Can't parse 'Require %s %s': %s",
338 provider_name, provider_args,
err);
364 ?
"denied (no authenticated user yet)"
377 ? (
section->negate ?
"NotAll" :
"All")
378 : (
section->negate ?
"None" :
"Any")),
417 "Unknown Authz provider: %s",
422 if (!
section->provider->check_authorization) {
424 "The '%s' Authz provider is not supported by any "
425 "of the loaded authorization modules",
431 if (
section->provider->parse_require_line) {
438 &
section->provider_parsed_args);
460 while (child->
next) {
486 "> directive missing closing '>'",
NULL);
493 "> directive doesn't take additional arguments",
540 "no effect in %s directive",
555 while (child->
next) {
568 " directive contains no authorization directives",
591 "Off | And | Or",
NULL);
614 child = child->
first;
625 }
while (child->
next && (child = child->
next));
648 "%s directive contains only negative authorization directives",
649 is_conf ?
"<Directory>, <Location>, or similar"
686 "container for grouping an authorization provider's "
687 "directives under a provider alias"),
689 "specifies authorization directives "
690 "which one must pass (or not) for a request to suceeed"),
692 "container for grouping authorization directives "
693 "of which none must fail and at least one must pass "
694 "for a request to succeed"),
696 "container for grouping authorization directives "
697 "of which one must pass "
698 "for a request to succeed"),
699#ifdef AUTHZ_EXTRA_CONFIGS
701 "container for grouping authorization directives "
702 "of which some must fail or none must pass "
703 "for a request to succeed"),
706 "container for grouping authorization directives "
707 "of which none must pass "
708 "for a request to succeed"),
710 "controls how a <Directory>, <Location>, or similar "
711 "directive's authorization directives are combined with "
712 "those of its predecessor"),
716 "Controls if an authorization failure should result in a "
717 "'403 FORBIDDEN' response instead of the HTTP-conforming "
718 "'401 UNAUTHORIZED'"),
734 "authorization result of %s: %s "
735 "(directive limited to other methods)",
748 section->provider_parsed_args);
816 "authorization result of %s: %s",
837 "AuthType configured with no corresponding "
838 "authorization directives");
844 "authorization result: granted (no directives)");
857 "authorization failure (no authenticated user): %s",
880 "client denied by server configuration: %s%s",
888 "user %s: authorization failure for \"%s\": ",
1000 return "Argument for 'Require all' must be 'granted' or 'denied'";
1057#define REQUIRE_EXPR_NOTE "Require_expr_info"
1070 info->want_user = 1;
1078 const char *expr_err =
NULL;
1098 "Cannot parse expression in require line: ",
1116 "Error evaluating expression in 'Require expr': %s",
1121 if (
info->want_user)
Symbol export macros and hook functions.
const char apr_size_t len
APR Standard Headers Support.
ap_conf_vector_t * ap_merge_per_dir_configs(apr_pool_t *p, ap_conf_vector_t *base, ap_conf_vector_t *new_conf)
ap_conf_vector_t * ap_create_per_dir_config(apr_pool_t *p)
#define AP_INIT_TAKE1(directive, func, mconfig, where, help)
#define ap_get_module_config(v, m)
struct ap_conf_vector_t ap_conf_vector_t
#define AP_DECLARE_MODULE(foo)
#define AP_INIT_FLAG(directive, func, mconfig, where, help)
const char * ap_set_flag_slot_char(cmd_parms *cmd, void *struct_ptr, int arg)
void ap_hook_check_config(ap_HOOK_check_config_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
#define AP_INIT_RAW_ARGS(directive, func, mconfig, where, help)
void ap_hook_pre_config(ap_HOOK_pre_config_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
ap_conf_vector_t const char * section
const char * ap_walk_config(ap_directive_t *conftree, cmd_parms *parms, ap_conf_vector_t *section_vector)
const char * ap_auth_type(request_rec *r)
int ap_method_number_of(const char *method)
void ap_note_auth_failure(request_rec *r)
void * ap_lookup_provider(const char *provider_group, const char *provider_name, const char *provider_version)
apr_status_t ap_register_auth_provider(apr_pool_t *pool, const char *provider_group, const char *provider_name, const char *provider_version, const void *provider, int type)
#define AP_AUTH_INTERNAL_PER_CONF
void ap_hook_check_access_ex(ap_HOOK_access_checker_ex_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder, int type)
void ap_hook_check_authz(ap_HOOK_auth_checker_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder, int type)
#define APR_REGISTER_OPTIONAL_FN(name)
int ap_expr_lookup_default(ap_expr_lookup_parms *parms)
#define ap_expr_parse_cmd(cmd, expr, flags, err, lookup_fn)
int ap_expr_exec(request_rec *r, const ap_expr_info_t *expr, const char **err)
#define HTTP_INTERNAL_SERVER_ERROR
#define HTTP_UNAUTHORIZED
#define STANDARD20_MODULE_STUFF
#define ap_strrchr_c(s, c)
#define AP_DEBUG_ASSERT(exp)
char * ap_getword_conf(apr_pool_t *p, const char **line)
const char * ap_check_cmd_context(cmd_parms *cmd, unsigned forbidden)
apr_array_header_t ** result
int strcasecmp(const char *a, const char *b)
#define APR_HASH_KEY_STRING
#define apr_pcalloc(p, size)
apr_int32_t apr_int32_t apr_int32_t err
const char const char *const * args
Authentication and Authorization Extension for Apache.
#define AUTHZ_PROVIDER_NAME_NOTE
#define AUTHZ_PROVIDER_VERSION
#define AUTHZ_PROVIDER_GROUP
static void * create_authz_core_svr_config(apr_pool_t *p, server_rec *s)
static int authz_core_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp)
static authz_status all_check_authorization(request_rec *r, const char *require_line, const void *parsed_require_line)
static authz_section_conf * create_default_section(apr_pool_t *p)
static const char * method_parse_config(cmd_parms *cmd, const char *require_line, const void **parsed_require_line)
static int authorize_user(request_rec *r)
static const char * authz_merge_sections(cmd_parms *cmd, void *mconfig, const char *arg)
static authz_status method_check_authorization(request_rec *r, const char *require_line, const void *parsed_require_line)
static int authz_core_check_section(apr_pool_t *p, server_rec *s, authz_section_conf *section, int is_conf)
static void * merge_authz_core_svr_config(apr_pool_t *p, void *basev, void *newv)
static const char * expr_parse_config(cmd_parms *cmd, const char *require_line, const void **parsed_require_line)
static int authorize_user_core(request_rec *r, int after_authn)
static int authz_some_auth_required(request_rec *r)
static void * merge_authz_core_dir_config(apr_pool_t *p, void *basev, void *newv)
static const char * format_authz_result(authz_status result)
#define REQUIRE_EXPR_NOTE
static authz_status apply_authz_sections(request_rec *r, authz_section_conf *section, authz_logic_op parent_op)
static int authz_core_check_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
static const char * format_authz_command(apr_pool_t *p, authz_section_conf *section)
static const command_rec authz_cmds[]
static const authz_provider authz_method_provider
static int authorize_userless(request_rec *r)
static const authz_provider authz_all_provider
static void register_hooks(apr_pool_t *p)
static const char * all_parse_config(cmd_parms *cmd, const char *require_line, const void **parsed_require_line)
static const authz_provider authz_env_provider
static const authz_provider authz_expr_provider
static authz_core_dir_conf * authz_core_first_dir_conf
static authz_status env_check_authorization(request_rec *r, const char *require_line, const void *parsed_require_line)
static const char * add_authz_section(cmd_parms *cmd, void *mconfig, const char *args)
static const authz_provider authz_alias_provider
static void * create_authz_core_dir_config(apr_pool_t *p, char *dummy)
static authz_status authz_alias_check_authorization(request_rec *r, const char *require_args, const void *parsed_require_args)
static authz_status expr_check_authorization(request_rec *r, const char *require_line, const void *parsed_require_line)
static const char * authz_require_alias_section(cmd_parms *cmd, void *mconfig, const char *args)
static const char * add_authz_provider(cmd_parms *cmd, void *config, const char *args)
static int expr_lookup_fn(ap_expr_lookup_parms *parms)
authz_section_conf * section
authz_core_dir_conf * next
signed char authz_forbidden_on_fail
const char * provider_args
const authz_provider * provider
const char * provider_name
authz_section_conf * first
const void * provider_parsed_args
authz_section_conf * next
const authz_provider * provider
const void * provider_parsed_args
ap_conf_vector_t * sec_auth
A structure that represents the current request.
apr_table_t * subprocess_env
struct ap_conf_vector_t * per_dir_config
A structure to keep track of authorization requirements.
A structure to store information for each virtual server.
struct ap_conf_vector_t * module_config