2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

1612. [bug] check-names at the option/view level could trigger

an INSIST. [RT# 11116]
This commit is contained in:
Mark Andrews
2004-04-20 14:11:47 +00:00
parent 349f684cf1
commit 1cf54d1966
5 changed files with 79 additions and 71 deletions

View File

@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: config.c,v 1.48 2004/04/19 23:09:51 marka Exp $ */
/* $Id: config.c,v 1.49 2004/04/20 14:11:46 marka Exp $ */
#include <config.h>
@@ -195,7 +195,7 @@ ns_config_parsedefaults(cfg_parser_t *parser, cfg_obj_t **conf) {
}
isc_result_t
ns_config_get(cfg_obj_t **maps, const char* name, cfg_obj_t **obj) {
ns_config_get(cfg_obj_t **maps, const char *name, cfg_obj_t **obj) {
int i;
for (i = 0;; i++) {
@@ -206,6 +206,41 @@ ns_config_get(cfg_obj_t **maps, const char* name, cfg_obj_t **obj) {
}
}
isc_result_t
ns_checknames_get(cfg_obj_t **maps, const char *which, cfg_obj_t **obj) {
cfg_listelt_t *element;
cfg_obj_t *checknames;
cfg_obj_t *type;
cfg_obj_t *value;
int i;
for (i = 0;; i++) {
if (maps[i] == NULL)
return (ISC_R_NOTFOUND);
checknames = NULL;
if (cfg_map_get(maps[i], "check-names", &checknames) == ISC_R_SUCCESS) {
/*
* Zone map entry is not a list.
*/
if (checknames != NULL && !cfg_obj_islist(checknames)) {
*obj = checknames;
return (ISC_R_SUCCESS);
}
for (element = cfg_list_first(checknames);
element != NULL;
element = cfg_list_next(element)) {
value = cfg_listelt_value(element);
type = cfg_tuple_get(value, "type");
if (strcasecmp(cfg_obj_asstring(type), which) == 0) {
*obj = cfg_tuple_get(value, "mode");
return (ISC_R_SUCCESS);
}
}
}
}
}
int
ns_config_listcount(cfg_obj_t *list) {
cfg_listelt_t *e;