named-checkconf.c revision 35f6a21f5f8114542c050bfcb484b39ce513d4bd
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews * Copyright (C) 2004-2007, 2009-2014 Internet Systems Consortium, Inc. ("ISC")
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews * Copyright (C) 1999-2002 Internet Software Consortium.
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews * Permission to use, copy, modify, and/or distribute this software for any
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews * purpose with or without fee is hereby granted, provided that the above
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews * copyright notice and this permission notice appear in all copies.
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews * PERFORMANCE OF THIS SOFTWARE.
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews/* $Id: named-checkconf.c,v 1.56 2011/03/12 04:59:46 tbox Exp $ */
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews fprintf(stderr, "usage: %s [-h] [-j] [-p] [-v] [-z] [-t directory] "
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews/*% directory callback */
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrewsdirectory_callback(const char *clausename, const cfg_obj_t *obj, void *arg) {
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews REQUIRE(strcasecmp("directory", clausename) == 0);
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews * Change directory.
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews "change directory to '%s' failed: %s\n",
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrewsget_maps(const cfg_obj_t **maps, const char *name, const cfg_obj_t **obj) {
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews for (i = 0;; i++) {
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews if (cfg_map_get(maps[i], name, obj) == ISC_R_SUCCESS)
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrewsget_checknames(const cfg_obj_t **maps, const cfg_obj_t **obj) {
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews for (i = 0;; i++) {
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews result = cfg_map_get(maps[i], "check-names", &checknames);
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews if (checknames != NULL && !cfg_obj_islist(checknames)) {
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews if (strcasecmp(cfg_obj_asstring(type), "master") != 0)
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrewsconfig_get(const cfg_obj_t **maps, const char *name, const cfg_obj_t **obj) {
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews for (i = 0;; i++) {
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews if (cfg_map_get(maps[i], name, obj) == ISC_R_SUCCESS)
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrewsconfigure_hint(const char *zfile, const char *zclass, isc_mem_t *mctx) {
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews result = dns_rdataclass_fromtext(&rdclass, &r);
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews result = dns_rootns_create(mctx, rdclass, zfile, &db);
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews/*% configure the zone */
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrewsconfigure_zone(const char *vclass, const char *view,
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews zone_options = DNS_ZONEOPT_CHECKNS | DNS_ZONEOPT_MANYERRORS;
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews zname = cfg_obj_asstring(cfg_tuple_get(zconfig, "name"));
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews * Check hints files for hint zones.
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews * Skip loading checks for any type other than
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews * master and redirect
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews if (strcasecmp(cfg_obj_asstring(typeobj), "hint") == 0)
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews else if ((strcasecmp(cfg_obj_asstring(typeobj), "master") != 0) &&
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews (strcasecmp(cfg_obj_asstring(typeobj), "redirect") != 0))
44a966dff66061ac3f266c6b451a70733eb78e82Mark Andrews if (get_maps(maps, "check-dup-records", &obj)) {
INSIST(0);
INSIST(0);
INSIST(0);
INSIST(0);
INSIST(0);
INSIST(0);
INSIST(0);
return (result);
static isc_result_t
return (result);
static isc_result_t
const char *vclass;
const char *vname;
return (result);
int exit_status = 0;
unsigned int flags = 0;
debug++;
exit(0);
usage();
usage();
#ifdef _WIN32
InitSockets();
== ISC_R_SUCCESS);
#ifdef _WIN32
return (exit_status);