/* 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 *
*/
/* * To save memory if the same subnets are used in hundres of vhosts, we store * each subnet only once and use this temporary hash to find it again.
*/ static apr_hash_t *parsed_subnets;
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.
*/
/* The 'ip' provider will allow the configuration to specify a list of ip addresses to check rather than a single address. This is different
from the previous host based syntax. */
t = require_line; while ((w = ap_getword_conf(ptemp, &t)) && w[0])
count++;
if (count == 0) return"'require ip' requires an argument";
/* The 'host' provider will allow the configuration to specify a list of host names to check rather than a single name. This is different
from the previous host based syntax. */
t = require;
/* '#' is not a valid hostname character and admin could * specify 'Require host localhost# Add example.com later'. We
* should not grant access to 'example.com' in that case. */
w = ap_strchr_c(t, '#'); if (w) { if (w == t) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(10120) "authz_host authorize: dubious empty " "'Require host %s' with only comment", t); return AUTHZ_DENIED;
}
staticint authz_host_pre_config(apr_pool_t *p, apr_pool_t *plog,
apr_pool_t *ptemp)
{ /* we only use this hash in the parse config phase, ptemp is enough */
parsed_subnets = apr_hash_make(ptemp);
staticint authz_host_post_config(apr_pool_t *p, apr_pool_t *plog,
apr_pool_t *ptemp, server_rec *s)
{ /* make sure we don't use this during .htaccess parsing */
parsed_subnets = NULL;
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.