diff --git a/CHANGES b/CHANGES index 34c37ac11a..627494adf8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,4 @@ + 625. [func] Zone's now inherit their class from the enclosing view. 624. [bug] The zone object could get timer events after it had been destroyed, causing a server crash. [RT #571] diff --git a/doc/arm/Bv9ARM-book.xml b/doc/arm/Bv9ARM-book.xml index 872b0d4d14..134b67b2c2 100644 --- a/doc/arm/Bv9ARM-book.xml +++ b/doc/arm/Bv9ARM-book.xml @@ -2,7 +2,7 @@ - + @@ -3805,9 +3805,12 @@ Classes other than IN have no built-in defaults hints. Class -The zone's name may optionally be followed by a class. If -a class is not specified, class IN (for Internet), -is assumed. This is correct for the vast majority of cases. +In general class can now be omitted from +a zone's definition. +It is now inherited for the enclosing view or if +there is no explicit view, from the default +view which is IN +(for Internet). The hesiod class is named for an information service from MIT's Project Athena. It is used to share information about various systems databases, such diff --git a/lib/dns/config/confparser.y.dirty b/lib/dns/config/confparser.y.dirty index 47c69f5373..13b4e8f7a2 100644 --- a/lib/dns/config/confparser.y.dirty +++ b/lib/dns/config/confparser.y.dirty @@ -33,7 +33,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: confparser.y.dirty,v 1.43 2000/12/13 00:15:23 tale Exp $ */ +/* $Id: confparser.y.dirty,v 1.44 2000/12/20 03:36:19 marka Exp $ */ #include @@ -3644,6 +3644,7 @@ secret: L_SECRET any_string L_EOS view_stmt: L_VIEW any_string optional_class L_LBRACE { dns_c_view_t *view; + dns_rdataclass_t rdclass; if (currcfg->views == NULL) { tmpres = dns_c_viewtable_new(currcfg->mem, @@ -3655,8 +3656,10 @@ view_stmt: L_VIEW any_string optional_class L_LBRACE YYABORT; } } + rdclass = ($3 == dns_rdataclass_reserved0) ? + dns_rdataclass_in : $3; - tmpres = dns_c_view_new(currcfg->mem, $2, $3, &view); + tmpres = dns_c_view_new(currcfg->mem, $2, rdclass, &view); if (tmpres != ISC_R_SUCCESS) { isc_mem_free(memctx, $2); parser_error(ISC_FALSE, @@ -4831,6 +4834,8 @@ domain_name: L_QSTRING zone_stmt: L_ZONE domain_name optional_class L_LBRACE L_TYPE zone_type L_EOS { dns_c_zone_t *zone; + dns_c_view_t *view = dns_c_ctx_getcurrview(currcfg); + dns_rdataclass_t rdclass; if (currcfg->zlist == NULL) { tmpres = dns_c_zonelist_new(currcfg->mem, @@ -4844,10 +4849,17 @@ zone_stmt: L_ZONE domain_name optional_class L_LBRACE L_TYPE zone_type L_EOS YYABORT; } } + rdclass = $3; + if (rdclass == dns_rdataclass_reserved0) { + if (view != NULL) + (void)dns_c_view_getviewclass(view, &rdclass); + else + rdclass = dns_rdataclass_in; + } /* XXX internal name support needed! */ tmpres = dns_c_zone_new(currcfg->mem, - $6, $3, $2, $2, &zone); + $6, rdclass, $2, $2, &zone); if (tmpres != ISC_R_SUCCESS) { isc_log_write(dns_lctx, DNS_LOGCATEGORY_CONFIG, DNS_LOGMODULE_CONFIG, @@ -4971,7 +4983,7 @@ wild_class_name: any_string optional_class: /* Empty */ { - $$ = dns_rdataclass_in; + $$ = dns_rdataclass_reserved0; } | class_name ; @@ -6021,8 +6033,12 @@ lwres_option: L_LISTEN_ON port_ip_list | L_VIEW any_string optional_class { dns_c_lwres_t *lwres; + dns_rdataclass_t rdclass; + lwres = ISC_LIST_TAIL(currcfg->lwres->lwreslist); - tmpres = dns_c_lwres_setview(lwres, $2, $3); + rdclass = ($3 == dns_rdataclass_reserved0) ? + dns_rdataclass_in : $3; + tmpres = dns_c_lwres_setview(lwres, $2, rdclass); if (tmpres == ISC_R_EXISTS) { parser_error(ISC_FALSE, "cannot redefine view"); YYABORT;