From b7064914ca566fdd67cf0fe7e82d586cbb596470 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Tue, 15 Jan 2002 06:42:15 +0000 Subject: [PATCH] 1177. [func] Report view when loading zones if it is not a standard view (_default or _bind). [RT #2270] --- CHANGES | 3 +++ lib/dns/zone.c | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index a04ddf52c2..3af4aee586 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +1177. [func] Report view when loading zones if it is not a + standard view (_default or _bind). [RT #2270] + 1176. [doc] Document that allow-v6-synthesis is only performed for clients that are supplied recursive service. [RT #2260] diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 2be0df253c..b391493a12 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: zone.c,v 1.357 2001/12/11 20:52:40 marka Exp $ */ +/* $Id: zone.c,v 1.358 2002/01/15 06:42:15 marka Exp $ */ #include @@ -4510,11 +4510,21 @@ zone_tostr(dns_zone_t *zone, char *buf, size_t length) { isc_buffer_init(&buffer, buf, length - 1); if (dns_name_dynamic(&zone->origin)) result = dns_name_totext(&zone->origin, ISC_TRUE, &buffer); - if (result != ISC_R_SUCCESS) + if (result != ISC_R_SUCCESS && + isc_buffer_availablelength(&buffer) >= (sizeof("") - 1)) isc_buffer_putstr(&buffer, ""); - isc_buffer_putstr(&buffer, "/"); + if (isc_buffer_availablelength(&buffer) > 0) + isc_buffer_putstr(&buffer, "/"); (void)dns_rdataclass_totext(zone->rdclass, &buffer); + + if (zone->view != NULL && strcmp(zone->view->name, "_bind") != 0 && + strcmp(zone->view->name, "_default") != 0 && + strlen(zone->view->name) < isc_buffer_availablelength(&buffer)) { + isc_buffer_putstr(&buffer, "/"); + isc_buffer_putstr(&buffer, zone->view->name); + } + buf[isc_buffer_usedlength(&buffer)] = '\0'; }