2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-03 16:15:27 +00:00
1168.   [bug]           Empty also-notify clauses were not handled. [RT #2309]
This commit is contained in:
Mark Andrews
2002-01-14 04:16:03 +00:00
parent e9472e9f18
commit b627356826
5 changed files with 32 additions and 18 deletions

View File

@@ -20,8 +20,7 @@
1169. [func] Identify recursive queries in the query log. 1169. [func] Identify recursive queries in the query log.
1168. [bug] Empty also-notify clauses were not handled gracefully. 1168. [bug] Empty also-notify clauses were not handled. [RT #2309]
[RT #2309]
1167. [contrib] nslint-2.1a3 (from author). 1167. [contrib] nslint-2.1a3 (from author).

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: config.c,v 1.24 2002/01/04 02:32:00 gson Exp $ */ /* $Id: config.c,v 1.25 2002/01/14 04:16:00 marka Exp $ */
#include <config.h> #include <config.h>
@@ -249,10 +249,14 @@ ns_config_getiplist(cfg_obj_t *config, cfg_obj_t *list,
isc_result_t result; isc_result_t result;
INSIST(addrsp != NULL && *addrsp == NULL); INSIST(addrsp != NULL && *addrsp == NULL);
INSIST(countp != NULL && *addrsp == 0);
addrlist = cfg_tuple_get(list, "addresses"); addrlist = cfg_tuple_get(list, "addresses");
count = ns_config_listcount(addrlist); count = ns_config_listcount(addrlist);
if (count == 0)
return (ISC_R_SUCCESS);
portobj = cfg_tuple_get(list, "port"); portobj = cfg_tuple_get(list, "port");
if (cfg_obj_isuint32(portobj)) { if (cfg_obj_isuint32(portobj)) {
isc_uint32_t val = cfg_obj_asuint32(portobj); isc_uint32_t val = cfg_obj_asuint32(portobj);

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: lwresd.c,v 1.40 2002/01/04 02:32:02 gson Exp $ */ /* $Id: lwresd.c,v 1.41 2002/01/14 04:15:59 marka Exp $ */
/* /*
* Main program for the Lightweight Resolver Daemon. * Main program for the Lightweight Resolver Daemon.
@@ -776,7 +776,7 @@ ns_lwresd_configure(isc_mem_t *mctx, cfg_obj_t *config) {
ns_lwresd_t *lwresd; ns_lwresd_t *lwresd;
in_port_t port; in_port_t port;
isc_sockaddr_t *addrs = NULL; isc_sockaddr_t *addrs = NULL;
isc_uint32_t count; isc_uint32_t count = 0;
lwres = cfg_listelt_value(element); lwres = cfg_listelt_value(element);
lwresd = NULL; lwresd = NULL;

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: zoneconf.c,v 1.97 2001/11/30 01:58:52 gson Exp $ */ /* $Id: zoneconf.c,v 1.98 2002/01/14 04:16:01 marka Exp $ */
#include <config.h> #include <config.h>
@@ -439,13 +439,14 @@ ns_zone_configure(cfg_obj_t *config, cfg_obj_t *vconfig, cfg_obj_t *zconfig,
result = ns_config_get(maps, "also-notify", &obj); result = ns_config_get(maps, "also-notify", &obj);
if (result == ISC_R_SUCCESS) { if (result == ISC_R_SUCCESS) {
isc_sockaddr_t *addrs = NULL; isc_sockaddr_t *addrs = NULL;
isc_uint32_t addrcount; isc_uint32_t addrcount = 0;
result = ns_config_getiplist(config, obj, 0, mctx, result = ns_config_getiplist(config, obj, 0, mctx,
&addrs, &addrcount); &addrs, &addrcount);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
return (result); return (result);
result = dns_zone_setalsonotify(zone, addrs, result = dns_zone_setalsonotify(zone, addrs,
addrcount); addrcount);
if (addrs != NULL)
ns_config_putiplist(mctx, &addrs, addrcount); ns_config_putiplist(mctx, &addrs, addrcount);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
return (result); return (result);

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: check.c,v 1.13 2001/12/29 04:49:51 marka Exp $ */ /* $Id: check.c,v 1.14 2002/01/14 04:15:58 marka Exp $ */
#include <config.h> #include <config.h>
@@ -57,7 +57,7 @@ typedef struct {
} intervaltable; } intervaltable;
static isc_result_t static isc_result_t
check_options(cfg_obj_t *options, isc_log_t *logctx) { check_options(cfg_obj_t *options, isc_log_t *logctx, isc_boolean_t toplevel) {
isc_result_t result = ISC_R_SUCCESS; isc_result_t result = ISC_R_SUCCESS;
unsigned int i; unsigned int i;
cfg_obj_t *obj = NULL; cfg_obj_t *obj = NULL;
@@ -102,12 +102,22 @@ check_options(cfg_obj_t *options, isc_log_t *logctx) {
(void)cfg_map_get(options, "also-notify", &obj); (void)cfg_map_get(options, "also-notify", &obj);
if (obj != NULL) { if (obj != NULL) {
cfg_obj_t *addrlist = NULL; cfg_obj_t *addrlist = NULL;
cfg_obj_t *port = NULL;
addrlist = cfg_tuple_get(obj, "addresses"); addrlist = cfg_tuple_get(obj, "addresses");
port = cfg_tuple_get(obj, "port");
if (cfg_list_first(addrlist) == NULL) { if (cfg_list_first(addrlist) == NULL) {
if (toplevel) {
cfg_obj_log(options, logctx, ISC_LOG_ERROR, cfg_obj_log(options, logctx, ISC_LOG_ERROR,
"empty 'also-notify' entry"); "empty 'also-notify' entry");
if (result == ISC_R_SUCCESS) if (result == ISC_R_SUCCESS)
result = ISC_R_FAILURE; result = ISC_R_FAILURE;
} else if (cfg_obj_isuint32(port)) {
cfg_obj_log(options, logctx, ISC_LOG_ERROR,
"port specified with "
"empty 'also-notify'");
if (result == ISC_R_SUCCESS)
result = ISC_R_FAILURE;
}
} }
} }
return (result); return (result);
@@ -347,7 +357,7 @@ check_zoneconf(cfg_obj_t *zconfig, isc_symtab_t *symtab,
/* /*
* Check various options. * Check various options.
*/ */
tresult = check_options(zoptions, logctx); tresult = check_options(zoptions, logctx, ISC_FALSE);
if (tresult != ISC_R_SUCCESS) if (tresult != ISC_R_SUCCESS)
result = tresult; result = tresult;
@@ -487,9 +497,9 @@ check_viewconf(cfg_obj_t *config, cfg_obj_t *vconfig, dns_rdataclass_t vclass,
} }
if (vconfig != NULL) if (vconfig != NULL)
tresult = check_options(vconfig, logctx); tresult = check_options(vconfig, logctx, ISC_FALSE);
else else
tresult = check_options(config, logctx); tresult = check_options(config, logctx, ISC_TRUE);
if (tresult != ISC_R_SUCCESS) if (tresult != ISC_R_SUCCESS)
result = tresult; result = tresult;
@@ -509,7 +519,7 @@ bind9_check_namedconf(cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx) {
(void)cfg_map_get(config, "options", &options); (void)cfg_map_get(config, "options", &options);
if (options != NULL && if (options != NULL &&
check_options(options, logctx) != ISC_R_SUCCESS) check_options(options, logctx, ISC_TRUE) != ISC_R_SUCCESS)
result = ISC_R_FAILURE; result = ISC_R_FAILURE;
(void)cfg_map_get(config, "view", &views); (void)cfg_map_get(config, "view", &views);