check.c revision 508f61f8d699c46f962b682f388e54b446a7194d
11e9368a226272085c337e9e74b79808c16fbdbaTinderbox User * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
75c0816e8295e180f4bc7f10db3d0d880383bc1cMark Andrews * Copyright (C) 2001-2003 Internet Software Consortium.
4a14ce5ba00ab7bc55c99ffdcf59c7a4ab902721Automatic Updater * Permission to use, copy, modify, and distribute this software for any
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein * purpose with or without fee is hereby granted, provided that the above
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein * copyright notice and this permission notice appear in all copies.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein * PERFORMANCE OF THIS SOFTWARE.
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein/* $Id: check.c,v 1.52 2005/01/09 23:40:00 marka Exp $ */
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeinfreekey(char *key, unsigned int type, isc_symvalue_t value, void *userarg) {
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeincheck_orderent(cfg_obj_t *ent, isc_log_t *logctx) {
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox User tresult = dns_rdataclass_fromtext(&rdclass, &r);
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox User "rrset-order: invalid class '%s'",
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein "rrset-order: invalid type '%s'",
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein tresult = dns_name_fromtext(dns_fixedname_name(&fixed), &b,
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox User strcasecmp("order", cfg_obj_asstring(obj)) != 0) {
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox User "rrset-order: keyword 'order' missing");
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User "rrset-order: missing ordering");
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User } else if (strcasecmp(cfg_obj_asstring(obj), "fixed") == 0) {
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User "rrset-order: order 'fixed' not implemented");
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User } else if (/* strcasecmp(cfg_obj_asstring(obj), "fixed") != 0 && */
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User strcasecmp(cfg_obj_asstring(obj), "random") != 0 &&
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User strcasecmp(cfg_obj_asstring(obj), "cyclic") != 0) {
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User "rrset-order: invalid order '%s'",
bbbf2e27d3a981163dab139497d6b2dc85449db0Tinderbox Usercheck_order(cfg_obj_t *options, isc_log_t *logctx) {
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User if (cfg_map_get(options, "rrset-order", &obj) != ISC_R_SUCCESS)
bcf15a19ae0efa72a22cdfb50666a3c6ce39eb9fTinderbox User tresult = check_orderent(cfg_listelt_value(element), logctx);
260e8e04b0dc24cb884c789b5d9eb046457f264eTinderbox Usercheck_dual_stack(cfg_obj_t *options, isc_log_t *logctx) {
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox User (void)cfg_map_get(options, "dual-stack-servers", &alternates);
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox User tresult = dns_name_fromtext(name, &buffer, dns_rootname,
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox Usercheck_forward(cfg_obj_t *options, isc_log_t *logctx) {
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox User (void)cfg_map_get(options, "forwarders", &forwarders);
af40ebed6257e4ac1996144530b3de317cf4da11Tinderbox User "no matching 'forwarders' statement");
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austeindisabled_algorithms(cfg_obj_t *disabled, isc_log_t *logctx) {
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt const char *str;
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User tresult = dns_name_fromtext(name, &b, dns_rootname, ISC_FALSE, NULL);
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt r.base = cfg_obj_asstring(cfg_listelt_value(element));
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Usernameexist(cfg_obj_t *obj, const char *name, int value, isc_symtab_t *symtab,
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User const char *fmt, isc_log_t *logctx, isc_mem_t *mctx)
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User unsigned int line;
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews result = isc_symtab_define(symtab, key, value, symvalue,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews RUNTIME_CHECK(isc_symtab_lookup(symtab, key, value,
f9aef05653eeb454c489d5bd2bde6daab774ad4aTinderbox User cfg_obj_log(obj, logctx, ISC_LOG_ERROR, fmt, key, file, line);
28b3569d6248168e6c00caab951521cc8141a49dAutomatic Updatermustbesecure(cfg_obj_t *secure, isc_symtab_t *symtab, isc_log_t *logctx,
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt result = dns_name_fromtext(name, &b, dns_rootname, ISC_FALSE, NULL);
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews dns_name_format(name, namebuf, sizeof(namebuf));
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "dnssec-must-be-secure '%s': already "
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "exists previous definition: %s:%u",
ad8f23aed6c75f94f238c1f23f4e17515d28eb55Tinderbox Usertypedef struct {
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater unsigned int max;
0c6ada0a814f3c5417daa1654129bc2af56ed504Automatic Updatercheck_options(cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx) {
71c66a876ecca77923638d3f94cc0783152b2f03Mark Andrews unsigned int i;
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater { "cleaning-interval", 60, 28 * 24 * 60 }, /* 28 days */
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater { "heartbeat-interval", 60, 28 * 24 * 60 }, /* 28 days */
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater { "interface-interval", 60, 28 * 24 * 60 }, /* 28 days */
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater { "max-transfer-idle-in", 60, 28 * 24 * 60 }, /* 28 days */
9b469e3c59015b1a4899c9d8395168126fe094fdAutomatic Updater { "max-transfer-idle-out", 60, 28 * 24 * 60 }, /* 28 days */
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater { "max-transfer-time-in", 60, 28 * 24 * 60 }, /* 28 days */
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater { "max-transfer-time-out", 60, 28 * 24 * 60 }, /* 28 days */
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater { "sig-validity-interval", 86400, 10 * 366 }, /* 10 years */
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater { "statistics-interval", 60, 28 * 24 * 60 }, /* 28 days */
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater * Check that fields specified in units of time other than seconds
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater * have reasonable values.
fdd80e9a55c70b36a3bf3e409b86897301c44ff8Automatic Updater for (i = 0; i < sizeof(intervals) / sizeof(intervals[0]); i++) {
e2e4d321999340802f77adaacd19c797d04b4b95Automatic Updater (void)cfg_map_get(options, intervals[i].name, &obj);
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein "%s '%u' is out of range (0..%u)",
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein } else if (val > (ISC_UINT32_MAX / intervals[i].scale)) {
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein "%s '%d' is out of range",
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein (void)cfg_map_get(options, "preferred-glue", &obj);
60e5e10f8d2e2b0c41e8abad38cacd867caa6ab2Rob Austein const char *str;
str);
char *str;
isc_buffer_t b;
str);
const char *dlv;
isc_buffer_t b;
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);
char *listname;
count++;
listname);
void * new;
goto cleanup;
if (stackcount != 0) {
goto newlist;
if (pushed != 0) {
goto resume;
return (result);
const char *name;
int allowed;
} optionstable;
static isc_result_t
const char *zname;
const char *typestr;
unsigned int ztype;
isc_buffer_t b;
return (ISC_R_FAILURE);
return (ISC_R_FAILURE);
return (ISC_R_FAILURE);
return (ISC_R_FAILURE);
zname);
zname);
zname);
zname);
return (result);
keyname);
return (ISC_R_FAILURE);
return (ISC_R_SUCCESS);
static isc_result_t
const char *file;
unsigned int line;
return (tresult);
return (tresult);
return (result);
static isc_result_t
const char *xfr;
== ISC_R_SUCCESS);
== ISC_R_SUCCESS);
return (result);
static isc_result_t
return (ISC_R_NOMEMORY);
return (ISC_R_NOMEMORY);
return (tresult);
return (tresult);
return (result);
default_channels[] = {
static isc_result_t
const char *channelname;
const char *catname;
return (ISC_R_SUCCESS);
return (result);
&symvalue);
return (result);
const char *file;
unsigned int line;
const char *aclname;
aclname);
const char *name;
const char *aclname;
const char *name;
return (result);