summaryrefslogtreecommitdiffstats
path: root/contrib/bind9/bin/check
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bind9/bin/check')
-rw-r--r--contrib/bind9/bin/check/check-tool.c7
-rw-r--r--contrib/bind9/bin/check/named-checkconf.c15
-rw-r--r--contrib/bind9/bin/check/named-checkzone.c22
3 files changed, 36 insertions, 8 deletions
diff --git a/contrib/bind9/bin/check/check-tool.c b/contrib/bind9/bin/check/check-tool.c
index cefee82..1b67ca8 100644
--- a/contrib/bind9/bin/check/check-tool.c
+++ b/contrib/bind9/bin/check/check-tool.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: check-tool.c,v 1.4.12.5 2004/03/08 04:04:13 marka Exp $ */
+/* $Id: check-tool.c,v 1.4.12.7 2004/11/30 01:15:40 marka Exp $ */
#include <config.h>
@@ -32,6 +32,7 @@
#include <isc/types.h>
#include <dns/fixedname.h>
+#include <dns/log.h>
#include <dns/name.h>
#include <dns/rdataclass.h>
#include <dns/types.h>
@@ -48,7 +49,9 @@ static const char *dbtype[] = { "rbt" };
int debug = 0;
isc_boolean_t nomerge = ISC_TRUE;
-unsigned int zone_options = DNS_ZONEOPT_CHECKNS|DNS_ZONEOPT_MANYERRORS;
+unsigned int zone_options = DNS_ZONEOPT_CHECKNS |
+ DNS_ZONEOPT_MANYERRORS |
+ DNS_ZONEOPT_CHECKNAMES;
isc_result_t
setup_logging(isc_mem_t *mctx, isc_log_t **logp) {
diff --git a/contrib/bind9/bin/check/named-checkconf.c b/contrib/bind9/bin/check/named-checkconf.c
index 88a7299..e7f9138 100644
--- a/contrib/bind9/bin/check/named-checkconf.c
+++ b/contrib/bind9/bin/check/named-checkconf.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: named-checkconf.c,v 1.12.12.7 2004/03/08 09:04:14 marka Exp $ */
+/* $Id: named-checkconf.c,v 1.12.12.9 2005/03/03 06:33:38 marka Exp $ */
#include <config.h>
@@ -25,6 +25,8 @@
#include <isc/commandline.h>
#include <isc/dir.h>
+#include <isc/entropy.h>
+#include <isc/hash.h>
#include <isc/log.h>
#include <isc/mem.h>
#include <isc/result.h>
@@ -35,6 +37,7 @@
#include <bind9/check.h>
+#include <dns/fixedname.h>
#include <dns/log.h>
#include <dns/result.h>
@@ -203,6 +206,7 @@ main(int argc, char **argv) {
isc_mem_t *mctx = NULL;
isc_result_t result;
int exit_status = 0;
+ isc_entropy_t *ectx = NULL;
isc_boolean_t load_zones = ISC_FALSE;
while ((c = isc_commandline_parse(argc, argv, "djt:vz")) != EOF) {
@@ -252,6 +256,10 @@ main(int argc, char **argv) {
RUNTIME_CHECK(setup_logging(mctx, &logc) == ISC_R_SUCCESS);
+ RUNTIME_CHECK(isc_entropy_create(mctx, &ectx) == ISC_R_SUCCESS);
+ RUNTIME_CHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE)
+ == ISC_R_SUCCESS);
+
dns_result_register();
RUNTIME_CHECK(cfg_parser_create(mctx, logc, &parser) == ISC_R_SUCCESS);
@@ -280,6 +288,9 @@ main(int argc, char **argv) {
isc_log_destroy(&logc);
+ isc_hash_destroy();
+ isc_entropy_detach(&ectx);
+
isc_mem_destroy(&mctx);
return (exit_status);
diff --git a/contrib/bind9/bin/check/named-checkzone.c b/contrib/bind9/bin/check/named-checkzone.c
index d023bd6..0eea166 100644
--- a/contrib/bind9/bin/check/named-checkzone.c
+++ b/contrib/bind9/bin/check/named-checkzone.c
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: named-checkzone.c,v 1.13.2.3.8.9 2004/03/06 10:21:11 marka Exp $ */
+/* $Id: named-checkzone.c,v 1.13.2.3.8.11 2004/10/25 01:36:06 marka Exp $ */
#include <config.h>
@@ -24,6 +24,8 @@
#include <isc/app.h>
#include <isc/commandline.h>
#include <isc/dir.h>
+#include <isc/entropy.h>
+#include <isc/hash.h>
#include <isc/log.h>
#include <isc/mem.h>
#include <isc/socket.h>
@@ -44,6 +46,7 @@
static int quiet = 0;
static isc_mem_t *mctx = NULL;
+static isc_entropy_t *ectx = NULL;
dns_zone_t *zone = NULL;
dns_zonetype_t zonetype = dns_zone_master;
static int dumpzone = 0;
@@ -63,7 +66,8 @@ static void
usage(void) {
fprintf(stderr,
"usage: named-checkzone [-djqvD] [-c class] [-o output] "
- "[-t directory] [-w directory] [-k option] zonename filename\n");
+ "[-t directory] [-w directory] [-k (ignore|warn|fail)] "
+ "[-n (ignore|warn|fail)] zonename filename\n");
exit(1);
}
@@ -111,12 +115,17 @@ main(int argc, char **argv) {
break;
case 'k':
- if (!strcmp(isc_commandline_argument, "check-names")) {
+ if (!strcmp(isc_commandline_argument, "warn")) {
zone_options |= DNS_ZONEOPT_CHECKNAMES;
+ zone_options &= ~DNS_ZONEOPT_CHECKNAMESFAIL;
} else if (!strcmp(isc_commandline_argument,
- "check-names-fail")) {
+ "fail")) {
zone_options |= DNS_ZONEOPT_CHECKNAMES |
DNS_ZONEOPT_CHECKNAMESFAIL;
+ } else if (!strcmp(isc_commandline_argument,
+ "ignore")) {
+ zone_options &= ~(DNS_ZONEOPT_CHECKNAMES |
+ DNS_ZONEOPT_CHECKNAMESFAIL);
}
break;
@@ -179,6 +188,9 @@ main(int argc, char **argv) {
dns_log_init(lctx);
dns_log_setcontext(lctx);
}
+ RUNTIME_CHECK(isc_entropy_create(mctx, &ectx) == ISC_R_SUCCESS);
+ RUNTIME_CHECK(isc_hash_create(mctx, ectx, DNS_NAME_MAXWIRE)
+ == ISC_R_SUCCESS);
dns_result_register();
@@ -195,6 +207,8 @@ main(int argc, char **argv) {
destroy();
if (lctx != NULL)
isc_log_destroy(&lctx);
+ isc_hash_destroy();
+ isc_entropy_detach(&ectx);
isc_mem_destroy(&mctx);
return ((result == ISC_R_SUCCESS) ? 0 : 1);
}
OpenPOWER on IntegriCloud