mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 15:05:23 +00:00
check for relationship between dnstap and dnstap-output seperately
This commit is contained in:
@@ -1356,16 +1356,6 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx,
|
|||||||
result = ISC_R_FAILURE;
|
result = ISC_R_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
(void) cfg_map_get(options, "dnstap", &obj);
|
|
||||||
if (obj != NULL) {
|
|
||||||
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
|
||||||
"'dnstap-output' must be set if 'dnstap' "
|
|
||||||
"is set");
|
|
||||||
if (result == ISC_R_SUCCESS) {
|
|
||||||
result = ISC_R_FAILURE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -3487,6 +3477,44 @@ check_one_plugin(const cfg_obj_t *config, const cfg_obj_t *obj,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static isc_result_t
|
||||||
|
check_dnstap(const cfg_obj_t *voptions, const cfg_obj_t *config,
|
||||||
|
isc_log_t *logctx)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_DNSTAP
|
||||||
|
const cfg_obj_t *options = NULL;
|
||||||
|
const cfg_obj_t *obj = NULL;
|
||||||
|
|
||||||
|
if (config != NULL) {
|
||||||
|
(void) cfg_map_get(config, "options", &options);
|
||||||
|
}
|
||||||
|
if (options != NULL) {
|
||||||
|
(void) cfg_map_get(options, "dnstap-output", &obj);
|
||||||
|
}
|
||||||
|
if (obj == NULL) {
|
||||||
|
if (voptions != NULL) {
|
||||||
|
(void) cfg_map_get(voptions, "dnstap", &obj);
|
||||||
|
}
|
||||||
|
if (options != NULL && obj == NULL) {
|
||||||
|
(void) cfg_map_get(options, "dnstap", &obj);
|
||||||
|
}
|
||||||
|
if (obj != NULL) {
|
||||||
|
cfg_obj_log(obj, logctx, ISC_LOG_ERROR,
|
||||||
|
"'dnstap-output' must be set if 'dnstap' "
|
||||||
|
"is set");
|
||||||
|
return (ISC_R_FAILURE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (ISC_R_SUCCESS);
|
||||||
|
#else
|
||||||
|
UNUSED(voptions);
|
||||||
|
UNUSED(config);
|
||||||
|
UNUSED(logctx);
|
||||||
|
|
||||||
|
return (ISC_R_SUCCESS);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static isc_result_t
|
static isc_result_t
|
||||||
check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
|
check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
|
||||||
const char *viewname, dns_rdataclass_t vclass,
|
const char *viewname, dns_rdataclass_t vclass,
|
||||||
@@ -3834,6 +3862,11 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
|
|||||||
result = tresult;
|
result = tresult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tresult = check_dnstap(voptions, config, logctx);
|
||||||
|
if (tresult != ISC_R_SUCCESS) {
|
||||||
|
result = tresult;
|
||||||
|
}
|
||||||
|
|
||||||
tresult = check_viewacls(actx, voptions, config, logctx, mctx);
|
tresult = check_viewacls(actx, voptions, config, logctx, mctx);
|
||||||
if (tresult != ISC_R_SUCCESS) {
|
if (tresult != ISC_R_SUCCESS) {
|
||||||
result = tresult;
|
result = tresult;
|
||||||
|
Reference in New Issue
Block a user