mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 05:57:52 +00:00
1612. [bug] check-names at the option/view level could trigger
an INSIST. [RT# 11116]
This commit is contained in:
parent
349f684cf1
commit
1cf54d1966
3
CHANGES
3
CHANGES
@ -18,7 +18,8 @@
|
|||||||
Missing #ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX/#endif.
|
Missing #ifdef ISC_PLATFORM_HAVEIFNAMETOINDEX/#endif.
|
||||||
[RT #11119]
|
[RT #11119]
|
||||||
|
|
||||||
1612. [placeholder] rt11116
|
1612. [bug] check-names at the option/view level could trigger
|
||||||
|
an INSIST. [RT# 11116]
|
||||||
|
|
||||||
1611. [bug] solaris: IPv6 interface scanning failed to cope with
|
1611. [bug] solaris: IPv6 interface scanning failed to cope with
|
||||||
no active IPv6 interfaces.
|
no active IPv6 interfaces.
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* 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>
|
#include <config.h>
|
||||||
|
|
||||||
@ -195,7 +195,7 @@ ns_config_parsedefaults(cfg_parser_t *parser, cfg_obj_t **conf) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
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;
|
int i;
|
||||||
|
|
||||||
for (i = 0;; 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
|
int
|
||||||
ns_config_listcount(cfg_obj_t *list) {
|
ns_config_listcount(cfg_obj_t *list) {
|
||||||
cfg_listelt_t *e;
|
cfg_listelt_t *e;
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: config.h,v 1.6 2004/03/05 04:57:55 marka Exp $ */
|
/* $Id: config.h,v 1.7 2004/04/20 14:11:47 marka Exp $ */
|
||||||
|
|
||||||
#ifndef NAMED_CONFIG_H
|
#ifndef NAMED_CONFIG_H
|
||||||
#define NAMED_CONFIG_H 1
|
#define NAMED_CONFIG_H 1
|
||||||
@ -31,6 +31,9 @@ ns_config_parsedefaults(cfg_parser_t *parser, cfg_obj_t **conf);
|
|||||||
isc_result_t
|
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);
|
||||||
|
|
||||||
|
isc_result_t
|
||||||
|
ns_checknames_get(cfg_obj_t **maps, const char* name, cfg_obj_t **obj);
|
||||||
|
|
||||||
int
|
int
|
||||||
ns_config_listcount(cfg_obj_t *list);
|
ns_config_listcount(cfg_obj_t *list);
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: server.c,v 1.424 2004/04/20 07:16:23 marka Exp $ */
|
/* $Id: server.c,v 1.425 2004/04/20 14:11:46 marka Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@ -399,7 +399,7 @@ mustbesecure(cfg_obj_t *mbs, dns_resolver_t *resolver)
|
|||||||
isc_buffer_init(&b, str, strlen(str));
|
isc_buffer_init(&b, str, strlen(str));
|
||||||
isc_buffer_add(&b, strlen(str));
|
isc_buffer_add(&b, strlen(str));
|
||||||
CHECK(dns_name_fromtext(name, &b, dns_rootname,
|
CHECK(dns_name_fromtext(name, &b, dns_rootname,
|
||||||
ISC_FALSE, NULL));
|
ISC_FALSE, NULL));
|
||||||
value = cfg_obj_asboolean(cfg_tuple_get(obj, "value"));
|
value = cfg_obj_asboolean(cfg_tuple_get(obj, "value"));
|
||||||
CHECK(dns_resolver_setmustbesecure(resolver, name, value));
|
CHECK(dns_resolver_setmustbesecure(resolver, name, value));
|
||||||
}
|
}
|
||||||
@ -857,33 +857,22 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
|
|||||||
* Check-names.
|
* Check-names.
|
||||||
*/
|
*/
|
||||||
obj = NULL;
|
obj = NULL;
|
||||||
str = "";
|
result = ns_checknames_get(maps, "response", &obj);
|
||||||
result = ns_config_get(maps, "check-names", &obj);
|
|
||||||
INSIST(result == ISC_R_SUCCESS);
|
INSIST(result == ISC_R_SUCCESS);
|
||||||
for (element = cfg_list_first(obj);
|
|
||||||
element != NULL;
|
|
||||||
element = cfg_list_next(element)) {
|
|
||||||
cfg_obj_t *value, *type;
|
|
||||||
value = cfg_listelt_value(element);
|
|
||||||
type = cfg_tuple_get(value, "type");
|
|
||||||
if (strcasecmp(cfg_obj_asstring(type), "response") == 0) {
|
|
||||||
str = cfg_obj_asstring(cfg_tuple_get(value, "mode"));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strcasecmp(str, "fail") == 0) {
|
str = cfg_obj_asstring(obj);
|
||||||
check = DNS_RESOLVER_CHECKNAMES |
|
if (strcasecmp(str, "fail") == 0) {
|
||||||
|
check = DNS_RESOLVER_CHECKNAMES |
|
||||||
DNS_RESOLVER_CHECKNAMESFAIL;
|
DNS_RESOLVER_CHECKNAMESFAIL;
|
||||||
view->checknames = ISC_TRUE;
|
view->checknames = ISC_TRUE;
|
||||||
} else if (strcasecmp(str, "warn") == 0) {
|
} else if (strcasecmp(str, "warn") == 0) {
|
||||||
check = DNS_RESOLVER_CHECKNAMES;
|
check = DNS_RESOLVER_CHECKNAMES;
|
||||||
view->checknames = ISC_FALSE;
|
view->checknames = ISC_FALSE;
|
||||||
} else if (strcasecmp(str, "ignore") == 0) {
|
} else if (strcasecmp(str, "ignore") == 0) {
|
||||||
check = 0;
|
check = 0;
|
||||||
view->checknames = ISC_FALSE;
|
view->checknames = ISC_FALSE;
|
||||||
} else
|
} else
|
||||||
INSIST(0);
|
INSIST(0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Resolver.
|
* Resolver.
|
||||||
@ -1199,7 +1188,7 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
|
|||||||
*/
|
*/
|
||||||
if (view->enablednssec) {
|
if (view->enablednssec) {
|
||||||
CHECK(configure_view_dnsseckeys(vconfig, config, mctx,
|
CHECK(configure_view_dnsseckeys(vconfig, config, mctx,
|
||||||
&view->secroots));
|
&view->secroots));
|
||||||
dns_resolver_resetmustbesecure(view->resolver);
|
dns_resolver_resetmustbesecure(view->resolver);
|
||||||
obj = NULL;
|
obj = NULL;
|
||||||
result = ns_config_get(maps, "dnssec-must-be-secure", &obj);
|
result = ns_config_get(maps, "dnssec-must-be-secure", &obj);
|
||||||
@ -1229,7 +1218,7 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
|
|||||||
view->preferred_glue = dns_rdatatype_aaaa;
|
view->preferred_glue = dns_rdatatype_aaaa;
|
||||||
else
|
else
|
||||||
view->preferred_glue = 0;
|
view->preferred_glue = 0;
|
||||||
} else
|
} else
|
||||||
view->preferred_glue = 0;
|
view->preferred_glue = 0;
|
||||||
|
|
||||||
obj = NULL;
|
obj = NULL;
|
||||||
@ -1950,7 +1939,7 @@ adjust_interfaces(ns_server_t *server, isc_mem_t *mctx) {
|
|||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
interface_timer_tick(isc_task_t *task, isc_event_t *event) {
|
interface_timer_tick(isc_task_t *task, isc_event_t *event) {
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
ns_server_t *server = (ns_server_t *) event->ev_arg;
|
ns_server_t *server = (ns_server_t *) event->ev_arg;
|
||||||
INSIST(task == server->task);
|
INSIST(task == server->task);
|
||||||
UNUSED(task);
|
UNUSED(task);
|
||||||
@ -2146,7 +2135,7 @@ load_configuration(const char *filename, ns_server_t *server,
|
|||||||
* option where the above parsing failed, parse resolv.conf.
|
* option where the above parsing failed, parse resolv.conf.
|
||||||
*/
|
*/
|
||||||
if (ns_g_lwresdonly &&
|
if (ns_g_lwresdonly &&
|
||||||
(lwresd_g_useresolvconf ||
|
(lwresd_g_useresolvconf ||
|
||||||
(!ns_g_conffileset && result == ISC_R_FILENOTFOUND)))
|
(!ns_g_conffileset && result == ISC_R_FILENOTFOUND)))
|
||||||
{
|
{
|
||||||
isc_log_write(ns_g_lctx,
|
isc_log_write(ns_g_lctx,
|
||||||
@ -3123,29 +3112,29 @@ ns_add_reserved_dispatch(ns_server_t *server, isc_sockaddr_t *addr) {
|
|||||||
dispatch->dispatchgen = server->dispatchgen;
|
dispatch->dispatchgen = server->dispatchgen;
|
||||||
dispatch->dispatch = NULL;
|
dispatch->dispatch = NULL;
|
||||||
|
|
||||||
attrs = 0;
|
attrs = 0;
|
||||||
attrs |= DNS_DISPATCHATTR_UDP;
|
attrs |= DNS_DISPATCHATTR_UDP;
|
||||||
switch (isc_sockaddr_pf(addr)) {
|
switch (isc_sockaddr_pf(addr)) {
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
attrs |= DNS_DISPATCHATTR_IPV4;
|
attrs |= DNS_DISPATCHATTR_IPV4;
|
||||||
break;
|
break;
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
attrs |= DNS_DISPATCHATTR_IPV6;
|
attrs |= DNS_DISPATCHATTR_IPV6;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
result = ISC_R_NOTIMPLEMENTED;
|
result = ISC_R_NOTIMPLEMENTED;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
attrmask = 0;
|
attrmask = 0;
|
||||||
attrmask |= DNS_DISPATCHATTR_UDP;
|
attrmask |= DNS_DISPATCHATTR_UDP;
|
||||||
attrmask |= DNS_DISPATCHATTR_TCP;
|
attrmask |= DNS_DISPATCHATTR_TCP;
|
||||||
attrmask |= DNS_DISPATCHATTR_IPV4;
|
attrmask |= DNS_DISPATCHATTR_IPV4;
|
||||||
attrmask |= DNS_DISPATCHATTR_IPV6;
|
attrmask |= DNS_DISPATCHATTR_IPV6;
|
||||||
|
|
||||||
result = dns_dispatch_getudp(ns_g_dispatchmgr, ns_g_socketmgr,
|
result = dns_dispatch_getudp(ns_g_dispatchmgr, ns_g_socketmgr,
|
||||||
ns_g_taskmgr, &dispatch->addr, 4096,
|
ns_g_taskmgr, &dispatch->addr, 4096,
|
||||||
1000, 32768, 16411, 16433,
|
1000, 32768, 16411, 16433,
|
||||||
attrs, attrmask, &dispatch->dispatch);
|
attrs, attrmask, &dispatch->dispatch);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: zoneconf.c,v 1.111 2004/03/30 02:13:43 marka Exp $ */
|
/* $Id: zoneconf.c,v 1.112 2004/04/20 14:11:46 marka Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@ -295,11 +295,7 @@ strtoargv(isc_mem_t *mctx, char *s, unsigned int *argcp, char ***argvp) {
|
|||||||
static void
|
static void
|
||||||
checknames(dns_zonetype_t ztype, cfg_obj_t **maps, cfg_obj_t **objp) {
|
checknames(dns_zonetype_t ztype, cfg_obj_t **maps, cfg_obj_t **objp) {
|
||||||
const char *zone = NULL;
|
const char *zone = NULL;
|
||||||
cfg_listelt_t *element;
|
isc_result_t result;
|
||||||
cfg_obj_t *type;
|
|
||||||
cfg_obj_t *value;
|
|
||||||
cfg_obj_t *check;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
switch (ztype) {
|
switch (ztype) {
|
||||||
case dns_zone_slave: zone = "slave"; break;
|
case dns_zone_slave: zone = "slave"; break;
|
||||||
@ -307,24 +303,8 @@ checknames(dns_zonetype_t ztype, cfg_obj_t **maps, cfg_obj_t **objp) {
|
|||||||
default:
|
default:
|
||||||
INSIST(0);
|
INSIST(0);
|
||||||
}
|
}
|
||||||
for (i = 0; maps[i] != NULL; i++) {
|
result = ns_checknames_get(maps, zone, objp);
|
||||||
check = NULL;
|
INSIST(result == ISC_R_SUCCESS);
|
||||||
cfg_map_get(maps[i], "check-names", &check);
|
|
||||||
if (check != NULL && !cfg_obj_islist(check)) {
|
|
||||||
*objp = check;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (element = cfg_list_first(check);
|
|
||||||
element != NULL;
|
|
||||||
element = cfg_list_next(element)) {
|
|
||||||
value = cfg_listelt_value(element);
|
|
||||||
type = cfg_tuple_get(value, "type");
|
|
||||||
if (strcasecmp(cfg_obj_asstring(type), zone) == 0) {
|
|
||||||
*objp = cfg_tuple_get(value, "mode");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
|
Loading…
x
Reference in New Issue
Block a user