977.   [bug]           Improve "not at top of zone" error message.
This commit is contained in:
Andreas Gustafsson 2001-09-04 22:51:41 +00:00
parent f6fc4b1391
commit 89227c76be
4 changed files with 32 additions and 6 deletions

View file

@ -1,4 +1,6 @@
977. [bug] Improve "not at top of zone" error message.
975. [bug] "max-cache-size default;" as a view option
caused an assertion failure.

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: master.h,v 1.31 2001/02/01 21:29:35 marka Exp $ */
/* $Id: master.h,v 1.31.2.1 2001/09/04 22:51:41 gson Exp $ */
#ifndef DNS_MASTER_H
#define DNS_MASTER_H 1
@ -36,6 +36,7 @@
#define DNS_MASTER_AGETTL 0x00000001 /* Age the ttl based on $DATE. */
#define DNS_MASTER_MANYERRORS 0x00000002 /* Continue processing on errors. */
#define DNS_MASTER_NOINCLUDE 0x00000004 /* Disallow $INCLUDE directives. */
#define DNS_MASTER_ZONE 0x00000008 /* Loading a zone master file. */
ISC_LANG_BEGINDECLS

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: master.c,v 1.122 2001/08/28 03:58:05 marka Exp $ */
/* $Id: master.c,v 1.122.2.1 2001/09/04 22:51:37 gson Exp $ */
#include <config.h>
@ -1396,6 +1396,27 @@ load(dns_loadctx_t *lctx) {
continue;
}
if (type == dns_rdatatype_soa &&
(lctx->options & DNS_MASTER_ZONE) != 0 &&
dns_name_compare(ictx->current, lctx->top) != 0) {
char namebuf[DNS_NAME_FORMATSIZE];
dns_name_format(ictx->current, namebuf,
sizeof(namebuf));
(*callbacks->error)(callbacks,
"dns_master_load: %s:%lu: SOA "
"record not at top of zone (%s)",
source, line, namebuf);
result = DNS_R_NOTZONETOP;
if (MANYERRS(lctx, result)) {
SETRESULT(lctx, result);
read_till_eol = ISC_TRUE;
target = target_ft;
continue;
} else if (result != ISC_R_SUCCESS)
goto insist_and_cleanup;
}
if (type == dns_rdatatype_sig)
covers = dns_rdata_covers(&rdata[rdcount]);
else

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: zone.c,v 1.333 2001/08/28 03:58:10 marka Exp $ */
/* $Id: zone.c,v 1.333.2.1 2001/09/04 22:51:38 gson Exp $ */
#include <config.h>
@ -1036,7 +1036,8 @@ zone_gotreadhandle(isc_task_t *task, isc_event_t *event) {
result = dns_master_loadfileinc(load->zone->masterfile,
dns_db_origin(load->db),
dns_db_origin(load->db),
load->zone->rdclass, 0,
load->zone->rdclass,
DNS_MASTER_ZONE,
&load->callbacks, task,
zone_loaddone, load,
&load->zone->lctx, load->zone->mctx);
@ -1087,16 +1088,17 @@ zone_startload(dns_db_t *db, dns_zone_t *zone, isc_time_t loadtime) {
result = DNS_R_CONTINUE;
} else if (DNS_ZONE_OPTION(zone, DNS_ZONEOPT_MANYERRORS)) {
dns_rdatacallbacks_t callbacks;
unsigned int options;
dns_rdatacallbacks_init(&callbacks);
result = dns_db_beginload(db, &callbacks.add,
&callbacks.add_private);
if (result != ISC_R_SUCCESS)
return (result);
options = DNS_MASTER_MANYERRORS|DNS_MASTER_ZONE;
result = dns_master_loadfile(zone->masterfile, &zone->origin,
&zone->origin, zone->rdclass,
DNS_MASTER_MANYERRORS,
&callbacks, zone->mctx);
options, &callbacks, zone->mctx);
tresult = dns_db_endload(db, &callbacks.add_private);
if (result == ISC_R_SUCCESS)
result = tresult;