summaryrefslogtreecommitdiff
path: root/bin/check/check-tool.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/check/check-tool.c')
-rw-r--r--bin/check/check-tool.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/bin/check/check-tool.c b/bin/check/check-tool.c
index 85067ddb..1deb9431 100644
--- a/bin/check/check-tool.c
+++ b/bin/check/check-tool.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: check-tool.c,v 1.31 2007/09/13 04:45:18 each Exp $ */
+/* $Id: check-tool.c,v 1.34 2008/01/18 23:46:57 tbox Exp $ */
/*! \file */
@@ -60,7 +60,7 @@
result = (r); \
if (result != ISC_R_SUCCESS) \
goto cleanup; \
- } while (0)
+ } while (0)
#define ERR_IS_CNAME 1
#define ERR_NO_ADDRESSES 2
@@ -78,7 +78,7 @@ isc_boolean_t nomerge = ISC_TRUE;
isc_boolean_t docheckmx = ISC_TRUE;
isc_boolean_t dochecksrv = ISC_TRUE;
isc_boolean_t docheckns = ISC_TRUE;
-unsigned int zone_options = DNS_ZONEOPT_CHECKNS |
+unsigned int zone_options = DNS_ZONEOPT_CHECKNS |
DNS_ZONEOPT_CHECKMX |
DNS_ZONEOPT_MANYERRORS |
DNS_ZONEOPT_CHECKNAMES |
@@ -109,7 +109,7 @@ freekey(char *key, unsigned int type, isc_symvalue_t value, void *userarg) {
UNUSED(type);
UNUSED(value);
isc_mem_free(userarg, key);
-}
+}
static void
add(char *key, int value) {
@@ -205,8 +205,9 @@ checkns(dns_zone_t *zone, dns_name_t *name, dns_name_t *owner,
!logged(namebuf, ERR_IS_CNAME)) {
dns_zone_log(zone, ISC_LOG_ERROR,
"%s/NS '%s' (out of zone) "
- "is a CNAME (illegal)",
- ownerbuf, namebuf);
+ "is a CNAME '%s' (illegal)",
+ ownerbuf, namebuf,
+ cur->ai_canonname);
/* XXX950 make fatal for 9.5.0 */
/* answer = ISC_FALSE; */
add(namebuf, ERR_IS_CNAME);
@@ -376,7 +377,7 @@ checkmx(dns_zone_t *zone, dns_name_t *name, dns_name_t *owner) {
if (dns_name_countlabels(name) > 1U)
strcat(namebuf, ".");
dns_name_format(owner, ownerbuf, sizeof(ownerbuf));
-
+
result = getaddrinfo(namebuf, NULL, &hints, &ai);
dns_name_format(name, namebuf, sizeof(namebuf) - 1);
switch (result) {
@@ -397,8 +398,10 @@ checkmx(dns_zone_t *zone, dns_name_t *name, dns_name_t *owner) {
if (!logged(namebuf, ERR_IS_MXCNAME)) {
dns_zone_log(zone, level,
"%s/MX '%s' (out of zone)"
- " is a CNAME (illegal)",
- ownerbuf, namebuf);
+ " is a CNAME '%s' "
+ "(illegal)",
+ ownerbuf, namebuf,
+ cur->ai_canonname);
add(namebuf, ERR_IS_MXCNAME);
}
if (level == ISC_LOG_ERROR)
@@ -459,7 +462,7 @@ checksrv(dns_zone_t *zone, dns_name_t *name, dns_name_t *owner) {
if (dns_name_countlabels(name) > 1U)
strcat(namebuf, ".");
dns_name_format(owner, ownerbuf, sizeof(ownerbuf));
-
+
result = getaddrinfo(namebuf, NULL, &hints, &ai);
dns_name_format(name, namebuf, sizeof(namebuf) - 1);
switch (result) {
@@ -480,8 +483,9 @@ checksrv(dns_zone_t *zone, dns_name_t *name, dns_name_t *owner) {
if (!logged(namebuf, ERR_IS_SRVCNAME)) {
dns_zone_log(zone, level, "%s/SRV '%s'"
" (out of zone) is a "
- "CNAME (illegal)",
- ownerbuf, namebuf);
+ "CNAME '%s' (illegal)",
+ ownerbuf, namebuf,
+ cur->ai_canonname);
add(namebuf, ERR_IS_SRVCNAME);
}
if (level == ISC_LOG_ERROR)