mod_authz_host.c revision 185aa71728867671e105178b4c66fbc22b65ae26
b565cd55a13dbccc4e66c344316da525c961e4caTill Mossakowski/* Licensed to the Apache Software Foundation (ASF) under one or more
b565cd55a13dbccc4e66c344316da525c961e4caTill Mossakowski * contributor license agreements. See the NOTICE file distributed with
179581802dda2f071129f542a2c10e28b35c45b9Christian Maeder * this work for additional information regarding copyright ownership.
b565cd55a13dbccc4e66c344316da525c961e4caTill Mossakowski * The ASF licenses this file to You under the Apache License, Version 2.0
b565cd55a13dbccc4e66c344316da525c961e4caTill Mossakowski * (the "License"); you may not use this file except in compliance with
179581802dda2f071129f542a2c10e28b35c45b9Christian Maeder * the License. You may obtain a copy of the License at
b565cd55a13dbccc4e66c344316da525c961e4caTill Mossakowski * http://www.apache.org/licenses/LICENSE-2.0
b565cd55a13dbccc4e66c344316da525c961e4caTill Mossakowski * Unless required by applicable law or agreed to in writing, software
b565cd55a13dbccc4e66c344316da525c961e4caTill Mossakowski * distributed under the License is distributed on an "AS IS" BASIS,
b565cd55a13dbccc4e66c344316da525c961e4caTill Mossakowski * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
b565cd55a13dbccc4e66c344316da525c961e4caTill Mossakowski * See the License for the specific language governing permissions and
179581802dda2f071129f542a2c10e28b35c45b9Christian Maeder * limitations under the License.
179581802dda2f071129f542a2c10e28b35c45b9Christian Maeder * Security options etc.
179581802dda2f071129f542a2c10e28b35c45b9Christian Maeder * Module derived from code originally written by Rob McCool
179581802dda2f071129f542a2c10e28b35c45b9Christian Maeder * To save memory if the same subnets are used in hundres of vhosts, we store
179581802dda2f071129f542a2c10e28b35c45b9Christian Maeder * each subnet only once and use this temporary hash to find it again.
179581802dda2f071129f542a2c10e28b35c45b9Christian Maederstatic int in_domain(const char *domain, const char *what)
179581802dda2f071129f542a2c10e28b35c45b9Christian Maeder if (strcasecmp(domain, &what[wl - dl]) != 0) {
179581802dda2f071129f542a2c10e28b35c45b9Christian Maeder /* Make sure we matched an *entire* subdomain --- if the user
const char *require_line,
const void **parsed_require_line)
int count = 0;
t = require_line;
count++;
if (count == 0)
t = require_line;
char *mask;
if (parsed_subnets &&
ip++;
w, msgbuf);
if (parsed_subnets)
ip++;
return NULL;
const char *require_line,
const void *parsed_require_line)
while (*ip) {
return AUTHZ_GRANTED;
ip++;
return AUTHZ_DENIED;
const char *require_line,
const void *parsed_require_line)
int remotehost_is_ip;
r->per_dir_config,
t = require_line;
return AUTHZ_GRANTED;
return AUTHZ_DENIED;
const char *require_line,
const void *parsed_require_line)
r->client_addr)
#if APR_HAVE_IPV6
return AUTHZ_GRANTED;
return AUTHZ_DENIED;
NULL,
NULL,
#if APR_HAVE_IPV6
return OK;
return OK;
NULL,