check.c revision f46168b87966f679a22aaf494c555f0de821aff9
499b34cea04a46823d003d4c0520c8b03e8513cbBrian Wellington * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC")
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * Copyright (C) 2001-2003 Internet Software Consortium.
dda4bfe6499d09ea8123447579e56069d8176fcbBob Halley * Permission to use, copy, modify, and/or distribute this software for any
dda4bfe6499d09ea8123447579e56069d8176fcbBob Halley * purpose with or without fee is hereby granted, provided that the above
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence * copyright notice and this permission notice appear in all copies.
15a44745412679c30a6d022733925af70a38b715David Lawrence * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
15a44745412679c30a6d022733925af70a38b715David Lawrence * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15a44745412679c30a6d022733925af70a38b715David Lawrence * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
15a44745412679c30a6d022733925af70a38b715David Lawrence * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15a44745412679c30a6d022733925af70a38b715David Lawrence * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15a44745412679c30a6d022733925af70a38b715David Lawrence * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15a44745412679c30a6d022733925af70a38b715David Lawrence * PERFORMANCE OF THIS SOFTWARE.
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellingtonfreekey(char *key, unsigned int type, isc_symvalue_t value, void *userarg) {
6fcfd0c35d3fd6aea3d36ad002b68e59ac62fdc7Brian Wellingtoncheck_orderent(const cfg_obj_t *ent, isc_log_t *logctx) {
6fcfd0c35d3fd6aea3d36ad002b68e59ac62fdc7Brian Wellington tresult = dns_rdataclass_fromtext(&rdclass, &r);
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "rrset-order: invalid class '%s'",
6fcfd0c35d3fd6aea3d36ad002b68e59ac62fdc7Brian Wellington tresult = dns_rdatatype_fromtext(&rdtype, &r);
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "rrset-order: invalid type '%s'",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington tresult = dns_name_fromtext(dns_fixedname_name(&fixed), &b,
6fcfd0c35d3fd6aea3d36ad002b68e59ac62fdc7Brian Wellington strcasecmp("order", cfg_obj_asstring(obj)) != 0) {
6fcfd0c35d3fd6aea3d36ad002b68e59ac62fdc7Brian Wellington "rrset-order: keyword 'order' missing");
6fcfd0c35d3fd6aea3d36ad002b68e59ac62fdc7Brian Wellington "rrset-order: missing ordering");
6fcfd0c35d3fd6aea3d36ad002b68e59ac62fdc7Brian Wellington } else if (strcasecmp(cfg_obj_asstring(obj), "fixed") == 0) {
6fcfd0c35d3fd6aea3d36ad002b68e59ac62fdc7Brian Wellington "rrset-order: order 'fixed' was disabled at "
6fcfd0c35d3fd6aea3d36ad002b68e59ac62fdc7Brian Wellington "compilation time");
6fcfd0c35d3fd6aea3d36ad002b68e59ac62fdc7Brian Wellington } else if (strcasecmp(cfg_obj_asstring(obj), "random") != 0 &&
6fcfd0c35d3fd6aea3d36ad002b68e59ac62fdc7Brian Wellington strcasecmp(cfg_obj_asstring(obj), "cyclic") != 0) {
6fcfd0c35d3fd6aea3d36ad002b68e59ac62fdc7Brian Wellington "rrset-order: invalid order '%s'",
6fcfd0c35d3fd6aea3d36ad002b68e59ac62fdc7Brian Wellingtoncheck_order(const cfg_obj_t *options, isc_log_t *logctx) {
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington if (cfg_map_get(options, "rrset-order", &obj) != ISC_R_SUCCESS)
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington tresult = check_orderent(cfg_listelt_value(element), logctx);
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellingtoncheck_dual_stack(const cfg_obj_t *options, isc_log_t *logctx) {
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington (void)cfg_map_get(options, "dual-stack-servers", &alternates);
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington obj = cfg_tuple_get(alternates, "addresses");
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington isc_buffer_init(&buffer, str, strlen(str));
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington tresult = dns_name_fromtext(name, &buffer, dns_rootname,
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellingtoncheck_forward(const cfg_obj_t *options, const cfg_obj_t *global,
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington (void)cfg_map_get(options, "forward", &forward);
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington (void)cfg_map_get(options, "forwarders", &forwarders);
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington if (forwarders != NULL && global != NULL) {
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington cfg_obj_log(forwarders, logctx, ISC_LOG_ERROR,
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "forwarders declared in root zone and "
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "in general configuration: %s:%u",
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington cfg_obj_log(forward, logctx, ISC_LOG_ERROR,
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington "no matching 'forwarders' statement");
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellingtondisabled_algorithms(const cfg_obj_t *disabled, isc_log_t *logctx) {
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellington tresult = dns_name_fromtext(name, &b, dns_rootname, 0, NULL);
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington obj = cfg_tuple_get(disabled, "algorithms");
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence DE_CONST(cfg_obj_asstring(cfg_listelt_value(element)), r.base);
7dc1fe241043e47a6721fd841e2c52d3691379ebBrian Wellington cfg_obj_log(cfg_listelt_value(element), logctx,
01d202be8fb07c010388eada31635e40ae3bffe5Brian Wellingtondisabled_ds_digests(const cfg_obj_t *disabled, isc_log_t *logctx) {
2fabf91e5bfc718f274e19c5fa8844fdae90ae41Brian Wellington tresult = dns_name_fromtext(name, &b, dns_rootname, 0, NULL);
2fabf91e5bfc718f274e19c5fa8844fdae90ae41Brian Wellington DE_CONST(cfg_obj_asstring(cfg_listelt_value(element)), r.base);
2fabf91e5bfc718f274e19c5fa8844fdae90ae41Brian Wellington /* works with a numeric argument too */
2fabf91e5bfc718f274e19c5fa8844fdae90ae41Brian Wellington tresult = dns_dsdigest_fromtext(&digest, &r);
2fabf91e5bfc718f274e19c5fa8844fdae90ae41Brian Wellington cfg_obj_log(cfg_listelt_value(element), logctx,
2fabf91e5bfc718f274e19c5fa8844fdae90ae41Brian Wellingtonnameexist(const cfg_obj_t *obj, const char *name, int value,
2fabf91e5bfc718f274e19c5fa8844fdae90ae41Brian Wellington isc_symtab_t *symtab, const char *fmt, isc_log_t *logctx,
2fabf91e5bfc718f274e19c5fa8844fdae90ae41Brian Wellington unsigned int line;
return (ISC_R_NOMEMORY);
return (result);
static isc_result_t
const char *str;
isc_buffer_t b;
return (result);
static isc_result_t
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
return (result);
static isc_result_t
unsigned int prefixlen;
int nbytes;
return (ISC_R_SUCCESS);
nbytes++;
sizeof(netaddrbuf));
return (result);
static isc_result_t
NULL };
return (result);
static isc_result_t
return (result);
goto failure;
return (result);
const char *name;
unsigned int scale;
unsigned int max;
} optlevel_t;
static isc_result_t
const char *str;
isc_buffer_t b;
static const char *server_contact[] = {
validity);
const char *str;
str);
const char *str;
isc_buffer_t b;
0, NULL);
str);
const char *dlv;
0, NULL);
NULL);
dlv);
str);
return (result);
static isc_result_t
return (result);
const char *listname;
return (ISC_R_SUCCESS);
return (ISC_R_NOTFOUND);
static isc_result_t
return (result);
const char *listname;
count++;
listname);
void * new;
goto cleanup;
if (stackcount != 0) {
void *ptr;
goto newlist;
if (pushed != 0) {
goto resume;
void *ptr;
return (result);
static isc_result_t
const char *str;
isc_buffer_t b;
return (ISC_R_SUCCESS);
return (result);
const char *name;
int allowed;
} optionstable;
static isc_result_t
return (result);
static isc_result_t
const char *znamestr;
const char *typestr;
unsigned int ztype;
isc_buffer_t b;
REDIRECTZONE },
return (ISC_R_FAILURE);
return (ISC_R_FAILURE);
return (ISC_R_FAILURE);
return (ISC_R_FAILURE);
return (ISC_R_FAILURE);
znamestr);
znamestr);
znamestr);
znamestr);
const char *arg;
znamestr);
if (root) {
const char *snamestr;
0, NULL);
znamestr);
return (result);
typedef struct keyalgorithms {
const char *name;
const char *algorithm;
{ "hmac-md5.sig-alg.reg.int", 0 },
{ "hmac-md5.sig-alg.reg.int.", 0 },
{ NULL, 0 }
keyname);
return (ISC_R_FAILURE);
return (result);
return (ISC_R_NOTFOUND);
return (ISC_R_RANGE);
return (ISC_R_RANGE);
keyname);
return (result);
return (ISC_R_SUCCESS);
static isc_result_t
isc_buffer_t b;
char *keyname;
0, NULL);
return (tresult);
return (ISC_R_NOMEMORY);
const char *file;
unsigned int line;
return (tresult);
return (result);
const char *v4;
const char *v6;
} sources[] = {
static isc_boolean_t
const char *str;
return (ISC_FALSE);
return (ISC_TRUE);
return (ISC_FALSE);
static isc_result_t
const char *xfr;
const char *keyval;
isc_buffer_t b;
int source;
return (ISC_R_SUCCESS);
source = 0;
0, NULL);
return (result);
static isc_result_t
isc_buffer_t b;
isc_region_t r;
if (managed) {
const char *initmethod;
isc_buffer_usedregion(&b, &r);
return (result);
static isc_result_t
return (ISC_R_NOMEMORY);
goto cleanup;
goto cleanup;
goto cleanup;
* Check that dnssec-enable/dnssec-validation are sensible.
valstr);
return (result);
default_channels[] = {
static isc_result_t
const char *channelname;
const char *catname;
return (ISC_R_SUCCESS);
return (result);
&symvalue);
return (result);
static isc_result_t
const char *keyval;
return (ISC_R_SUCCESS);
return (result);
static isc_result_t
const char *path;
return (ISC_R_SUCCESS);
logctx);
path);
#ifdef NEED_SECURE_DIRECTORY
logctx);
return (result);
const char *file;
unsigned int line;
const char *aclname;
aclname);
const char *name;
const char *aclname;
const char *name;
return (result);