/* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
*/
/* * Security options etc. * * Module derived from code originally written by Rob McCool *
*/
/* things in the 'order' array */ #define DENY_THEN_ALLOW 0 #define ALLOW_THEN_DENY 1 #define MUTUAL_FAILURE 2
typedefstruct { int order[METHODS];
apr_array_header_t *allows;
apr_array_header_t *denys; int *satisfy; /* for every method one */
} access_compat_dir_conf;
} elseif (!strcasecmp(where, "all")) {
a->type = T_ALL;
} elseif ((s = ap_strchr(where, '/'))) {
*s++ = '\0';
rv = apr_ipsubnet_create(&a->x.ip, where, s, cmd->pool); if(APR_STATUS_IS_EINVAL(rv)) { /* looked nothing like an IP address */ return"An IP address was expected";
} elseif (rv != APR_SUCCESS) { return apr_psprintf(cmd->pool, "%pm", &rv);
}
a->type = T_IP;
} elseif (!APR_STATUS_IS_EINVAL(rv = apr_ipsubnet_create(&a->x.ip, where,
NULL, cmd->pool))) { if (rv != APR_SUCCESS) return apr_psprintf(cmd->pool, "%pm", &rv);
a->type = T_IP;
} elseif (ap_strchr(where, '#')) { return"No comments are allowed here";
} else { /* no slash, didn't look like an IP address => must be a host */
a->type = T_HOST;
}
return NULL;
}
staticchar its_an_allow;
staticconst command_rec access_compat_cmds[] =
{
AP_INIT_TAKE1("order", order, NULL, OR_LIMIT, "'allow,deny', 'deny,allow', or 'mutual-failure'"),
AP_INIT_ITERATE2("allow", allow_cmd, &its_an_allow, OR_LIMIT, "'from' followed by hostnames or IP-address wildcards"),
AP_INIT_ITERATE2("deny", allow_cmd, NULL, OR_LIMIT, "'from' followed by hostnames or IP-address wildcards"),
AP_INIT_TAKE1("Satisfy", satisfy, NULL, OR_AUTHCFG, "access policy if both allow and require used ('all' or 'any')"),
{NULL}
};
staticint in_domain(constchar *domain, constchar *what)
{ int dl = strlen(domain); int wl = strlen(what);
if ((wl - dl) >= 0) { if (strcasecmp(domain, &what[wl - dl]) != 0) { return 0;
}
/* Make sure we matched an *entire* subdomain --- if the user * said 'allow from good.com', we don't want people from nogood.com * to be able to get in.
*/
/* This can be access checker since we don't require r->user to be set. */
ap_hook_check_access(check_dir_access, NULL, NULL, APR_HOOK_MIDDLE,
AP_AUTH_INTERNAL_PER_CONF);
}
AP_DECLARE_MODULE(access_compat) =
{
STANDARD20_MODULE_STUFF,
create_access_compat_dir_config, /* dir config creater */
NULL, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server config */
access_compat_cmds,
register_hooks /* register hooks */
};
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.