977. [bug] Improve "not at top of zone" error message.
+ 977. [bug] Improve "not at top of zone" error message.
+
975. [bug] "max-cache-size default;" as a view option
caused an assertion failure.
* 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
#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
* 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>
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
* 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>
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);
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;