mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +00:00
Allow views w/ same name and different class to be added to view list.
Change view add failure result test from == ISC_R_EXISTS -> != ISC_R_SUCCESS.
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: confparser.y.dirty,v 1.33 2000/12/01 09:03:41 marka Exp $ */
|
/* $Id: confparser.y.dirty,v 1.34 2000/12/01 23:27:40 marka Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -3693,7 +3693,7 @@ view_stmt: L_VIEW any_string optional_class L_LBRACE
|
|||||||
}
|
}
|
||||||
|
|
||||||
tmpres = dns_c_viewtable_addview(currcfg->views, view);
|
tmpres = dns_c_viewtable_addview(currcfg->views, view);
|
||||||
if (tmpres == ISC_R_EXISTS) {
|
if (tmpres != ISC_R_SUCCESS) {
|
||||||
dns_c_view_delete(&view);
|
dns_c_view_delete(&view);
|
||||||
parser_error(ISC_FALSE,
|
parser_error(ISC_FALSE,
|
||||||
"view '%s' already exists", $2);
|
"view '%s' already exists", $2);
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: confview.c,v 1.61 2000/12/01 19:50:52 gson Exp $ */
|
/* $Id: confview.c,v 1.62 2000/12/01 23:27:42 marka Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -235,7 +235,7 @@ dns_c_viewtable_new(isc_mem_t *mem, dns_c_viewtable_t **viewtable) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
isc_result_t
|
void
|
||||||
dns_c_viewtable_delete(dns_c_viewtable_t **viewtable) {
|
dns_c_viewtable_delete(dns_c_viewtable_t **viewtable) {
|
||||||
dns_c_viewtable_t *table;
|
dns_c_viewtable_t *table;
|
||||||
|
|
||||||
@@ -249,8 +249,6 @@ dns_c_viewtable_delete(dns_c_viewtable_t **viewtable) {
|
|||||||
|
|
||||||
table->magic = 0;
|
table->magic = 0;
|
||||||
isc_mem_put(table->mem, table, sizeof *table);
|
isc_mem_put(table->mem, table, sizeof *table);
|
||||||
|
|
||||||
return (ISC_R_SUCCESS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -284,7 +282,8 @@ dns_c_viewtable_addview(dns_c_viewtable_t *viewtable, dns_c_view_t *view) {
|
|||||||
|
|
||||||
elem = ISC_LIST_HEAD(viewtable->views);
|
elem = ISC_LIST_HEAD(viewtable->views);
|
||||||
while (elem != NULL) {
|
while (elem != NULL) {
|
||||||
if (strcmp(view->name, elem->name) == 0) {
|
if (strcmp(view->name, elem->name) == 0 &&
|
||||||
|
view->viewclass == elem->viewclass) {
|
||||||
return (ISC_R_EXISTS);
|
return (ISC_R_EXISTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,7 +306,7 @@ dns_c_viewtable_rmview(dns_c_viewtable_t *viewtable, dns_c_view_t *view) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
isc_result_t
|
void
|
||||||
dns_c_viewtable_clear(dns_c_viewtable_t *table) {
|
dns_c_viewtable_clear(dns_c_viewtable_t *table) {
|
||||||
dns_c_view_t *elem;
|
dns_c_view_t *elem;
|
||||||
dns_c_view_t *tmpelem;
|
dns_c_view_t *tmpelem;
|
||||||
@@ -322,8 +321,6 @@ dns_c_viewtable_clear(dns_c_viewtable_t *table) {
|
|||||||
dns_c_view_delete(&elem);
|
dns_c_view_delete(&elem);
|
||||||
elem = tmpelem;
|
elem = tmpelem;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (ISC_R_SUCCESS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: confview.h,v 1.45 2000/12/01 09:03:44 marka Exp $ */
|
/* $Id: confview.h,v 1.46 2000/12/01 23:27:43 marka Exp $ */
|
||||||
|
|
||||||
#ifndef DNS_CONFVIEW_H
|
#ifndef DNS_CONFVIEW_H
|
||||||
#define DNS_CONFVIEW_H 1
|
#define DNS_CONFVIEW_H 1
|
||||||
@@ -189,13 +189,13 @@ ISC_LANG_BEGINDECLS
|
|||||||
|
|
||||||
isc_result_t dns_c_viewtable_new(isc_mem_t *mem,
|
isc_result_t dns_c_viewtable_new(isc_mem_t *mem,
|
||||||
dns_c_viewtable_t **viewtable);
|
dns_c_viewtable_t **viewtable);
|
||||||
isc_result_t dns_c_viewtable_delete(dns_c_viewtable_t **viewtable);
|
void dns_c_viewtable_delete(dns_c_viewtable_t **viewtable);
|
||||||
|
|
||||||
void dns_c_viewtable_print(FILE *fp, int indent, dns_c_viewtable_t *table);
|
void dns_c_viewtable_print(FILE *fp, int indent, dns_c_viewtable_t *table);
|
||||||
isc_result_t dns_c_viewtable_addview(dns_c_viewtable_t *viewtable,
|
isc_result_t dns_c_viewtable_addview(dns_c_viewtable_t *viewtable,
|
||||||
dns_c_view_t *view);
|
dns_c_view_t *view);
|
||||||
void dns_c_viewtable_rmview(dns_c_viewtable_t *viewtable, dns_c_view_t *view);
|
void dns_c_viewtable_rmview(dns_c_viewtable_t *viewtable, dns_c_view_t *view);
|
||||||
isc_result_t dns_c_viewtable_clear(dns_c_viewtable_t *table);
|
void dns_c_viewtable_clear(dns_c_viewtable_t *table);
|
||||||
isc_result_t dns_c_viewtable_viewbyname(dns_c_viewtable_t *viewtable,
|
isc_result_t dns_c_viewtable_viewbyname(dns_c_viewtable_t *viewtable,
|
||||||
const char *viewname,
|
const char *viewname,
|
||||||
dns_c_view_t **retval);
|
dns_c_view_t **retval);
|
||||||
|
Reference in New Issue
Block a user