mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-04 00:25:29 +00:00
977. [bug] Improve "not at top of zone" error message.
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -1,3 +1,5 @@
|
||||
977. [bug] Improve "not at top of zone" error message.
|
||||
|
||||
976. [func] named-checkconf will now test load master zone
|
||||
files (-z). [RT #1468]
|
||||
|
||||
|
@@ -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.32 2001/09/04 00:35:19 marka 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
|
||||
|
||||
|
@@ -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.123 2001/09/04 00:35:17 marka 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
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: zone.c,v 1.339 2001/09/03 01:21:19 marka Exp $ */
|
||||
/* $Id: zone.c,v 1.340 2001/09/04 00:35:15 marka 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;
|
||||
|
Reference in New Issue
Block a user