diff --git a/CHANGES b/CHANGES index 4dfa294d19..9624968c31 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +1159. [bug] MD and MF are not permitted to be loaded by RFC1123. + 1158. [func] Report the client's address when logging notify messages. diff --git a/lib/dns/master.c b/lib/dns/master.c index 953809f370..a5be833ed5 100644 --- a/lib/dns/master.c +++ b/lib/dns/master.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: master.c,v 1.122.2.8.2.2 2003/08/11 05:28:15 marka Exp $ */ +/* $Id: master.c,v 1.122.2.8.2.3 2003/08/12 05:09:36 marka Exp $ */ #include @@ -1384,6 +1384,28 @@ load(dns_loadctx_t *lctx) { if (type == dns_rdatatype_ns && ictx->glue == NULL) current_has_delegation = ISC_TRUE; + /* + * RFC 1123: MD and MF are not allowed to be loaded from + * master files. + */ + if ((lctx->options & DNS_MASTER_ZONE) != 0 && + (type == dns_rdatatype_md || type == dns_rdatatype_mf)) { + char typename[DNS_RDATATYPE_FORMATSIZE]; + + result = DNS_R_OBSOLETE; + + dns_rdatatype_format(type, typename, sizeof(typename)); + (*callbacks->error)(callbacks, + "%s: %s:%lu: %s '%s': %s", + "dns_master_load", source, line, + "type", typename, + dns_result_totext(result)); + if (MANYERRS(lctx, result)) { + SETRESULT(lctx, result); + } else + goto insist_and_cleanup; + } + /* * Find a rdata structure. */