28#define APR_WANT_STRFUNC
29#define APR_WANT_BYTEFUNC
42#if APR_HAVE_NETINET_IN_H
43#include <netinet/in.h>
65#define DENY_THEN_ALLOW 0
66#define ALLOW_THEN_DENY 1
67#define MUTUAL_FAILURE 2
76module AP_MODULE_DECLARE_DATA access_compat_module;
109 return "unknown order";
131 return "Satisfy either 'any' or 'all'.";
148 char *
where = apr_pstrdup(
cmd->pool, where_c);
153 return "allow and deny must be followed by 'from'";
157 a->limited =
cmd->limited;
174 rv = apr_ipsubnet_create(&
a->x.ip,
where,
s,
cmd->pool);
177 return "An IP address was expected";
180 return apr_psprintf(
cmd->pool,
"%pm", &rv);
187 return apr_psprintf(
cmd->pool,
"%pm", &rv);
191 return "No comments are allowed here";
205 "'allow,deny', 'deny,allow', or 'mutual-failure'"),
207 "'from' followed by hostnames or IP-address wildcards"),
209 "'from' followed by hostnames or IP-address wildcards"),
211 "access policy if both allow and require used ('all' or 'any')"),
215static int in_domain(
const char *domain,
const char *what)
217 int dl = strlen(domain);
218 int wl = strlen(what);
220 if ((wl - dl) >= 0) {
221 if (
strcasecmp(domain, &what[wl - dl]) != 0) {
234 return (domain[0] ==
'.' || what[wl - dl - 1] ==
'.');
249 const char *remotehost =
NULL;
251 for (
i = 0;
i <
a->nelts; ++
i) {
252 if (!(mmask &
ap[
i].limited)) {
280 int remotehost_is_ip;
285 if ((remotehost ==
NULL) || remotehost_is_ip) {
293 if ((gothost == 2) &&
in_domain(
ap[
i].x.from, remotehost)) {
351 "client denied by server configuration: %s%s",
Symbol export macros and hook functions.
apr_size_t const unsigned char unsigned int unsigned int d
APR Standard Headers Support.
static apr_OFN_access_compat_ap_satisfies_t * access_compat_ap_satisfies
#define AP_INIT_TAKE1(directive, func, mconfig, where, help)
#define ap_get_module_config(v, m)
#define AP_INIT_ITERATE2(directive, func, mconfig, where, help)
#define AP_DECLARE_MODULE(foo)
#define AP_AUTH_INTERNAL_PER_CONF
void ap_hook_check_access(ap_HOOK_access_checker_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder, int type)
#define APR_STATUS_IS_EINVAL(s)
apr_bucket apr_bucket_brigade * a
#define APR_REGISTER_OPTIONAL_FN(name)
#define STANDARD20_MODULE_STUFF
int strcasecmp(const char *a, const char *b)
int strncasecmp(const char *a, const char *b, size_t n)
apr_vformatter_buff_t const char va_list ap
apr_uint32_t apr_pool_t apr_uint32_t apr_pollset_method_e method
#define apr_pcalloc(p, size)
const char * ap_get_useragent_host(request_rec *req, int type, int *str_is_ip)
#define REMOTE_DOUBLE_REV
static int find_allowdeny(request_rec *r, apr_array_header_t *a, int method)
static int in_domain(const char *domain, const char *what)
static void * create_access_compat_dir_config(apr_pool_t *p, char *dummy)
static const command_rec access_compat_cmds[]
static int check_dir_access(request_rec *r)
static const char * satisfy(cmd_parms *cmd, void *dv, const char *arg)
static void register_hooks(apr_pool_t *p)
static const char * allow_cmd(cmd_parms *cmd, void *dv, const char *from, const char *where_c)
static const char * order(cmd_parms *cmd, void *dv, const char *arg)
Authentication and Authorization Extension for Apache.
apr_array_header_t * allows
apr_array_header_t * denys
const apr_bucket_type_t * type
A structure that represents the current request.
apr_sockaddr_t * useragent_addr
apr_table_t * subprocess_env
struct ap_conf_vector_t * per_dir_config