rename cfg_aclconfctx_t variables to aclctx

ACL configuration context variables are inconsistently named as `actx`,
`ac`, or `aclconfctx`, which caused confusion during code reviews. This
commit renames all `cfg_aclconfctx_t` variables to `aclctx`, which is
short, consistent, and unambiguous.
This commit is contained in:
Colin Vidal 2025-09-24 11:10:29 +02:00
parent 23a79b42ea
commit 36a05c81b4
23 changed files with 294 additions and 287 deletions

View file

@ -901,7 +901,7 @@ get_key_info(const cfg_obj_t *config, const cfg_obj_t *control,
static void
update_listener(named_controls_t *cp, controllistener_t **listenerp,
const cfg_obj_t *control, const cfg_obj_t *config,
isc_sockaddr_t *addr, cfg_aclconfctx_t *aclconfctx,
isc_sockaddr_t *addr, cfg_aclconfctx_t *aclctx,
const char *socktext, isc_socktype_t type) {
controllistener_t *listener = NULL;
const cfg_obj_t *allow = NULL;
@ -988,7 +988,7 @@ update_listener(named_controls_t *cp, controllistener_t **listenerp,
*/
if (control != NULL && type == isc_socktype_tcp) {
allow = cfg_tuple_get(control, "allow");
result = cfg_acl_fromconfig(allow, config, aclconfctx,
result = cfg_acl_fromconfig(allow, config, aclctx,
listener->mctx, 0, &new_acl);
} else {
result = dns_acl_any(listener->mctx, &new_acl);
@ -1027,7 +1027,7 @@ update_listener(named_controls_t *cp, controllistener_t **listenerp,
static void
add_listener(named_controls_t *cp, controllistener_t **listenerp,
const cfg_obj_t *control, const cfg_obj_t *config,
isc_sockaddr_t *addr, cfg_aclconfctx_t *aclconfctx,
isc_sockaddr_t *addr, cfg_aclconfctx_t *aclctx,
const char *socktext, isc_socktype_t type) {
isc_mem_t *mctx = cp->server->mctx;
controllistener_t *listener = NULL;
@ -1061,7 +1061,7 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp,
const cfg_obj_t *readonly = NULL;
allow = cfg_tuple_get(control, "allow");
CHECK(cfg_acl_fromconfig(allow, config, aclconfctx, mctx, 0,
CHECK(cfg_acl_fromconfig(allow, config, aclctx, mctx, 0,
&new_acl));
readonly = cfg_tuple_get(control, "read-only");
@ -1134,7 +1134,7 @@ shuttingdown:
isc_result_t
named_controls_configure(named_controls_t *cp, const cfg_obj_t *config,
cfg_aclconfctx_t *aclconfctx) {
cfg_aclconfctx_t *aclctx) {
controllistener_t *listener = NULL;
controllistenerlist_t new_listeners;
const cfg_obj_t *controlslist = NULL;
@ -1205,7 +1205,7 @@ named_controls_configure(named_controls_t *cp, const cfg_obj_t *config,
socktext);
update_listener(cp, &listener, control, config,
&addr, aclconfctx, socktext,
&addr, aclctx, socktext,
isc_socktype_tcp);
if (listener != NULL) {
@ -1220,7 +1220,7 @@ named_controls_configure(named_controls_t *cp, const cfg_obj_t *config,
* This is a new listener.
*/
add_listener(cp, &listener, control,
config, &addr, aclconfctx,
config, &addr, aclctx,
socktext,
isc_socktype_tcp);
}

View file

@ -93,12 +93,12 @@ named_controls_destroy(named_controls_t **ctrlsp);
isc_result_t
named_controls_configure(named_controls_t *controls, const cfg_obj_t *config,
cfg_aclconfctx_t *aclconfctx);
cfg_aclconfctx_t *aclctx);
/*%<
* Configure zero or more command channels into 'controls'
* as defined in the configuration parse tree 'config'.
* The channels will evaluate ACLs in the context of
* 'aclconfctx'.
* 'aclctx'.
*/
void

View file

@ -110,7 +110,7 @@ struct named_server {
isc_signal_t *sighup;
isc_signal_t *sigusr1;
cfg_aclconfctx_t *aclconfctx;
cfg_aclconfctx_t *aclctx;
};
#define NAMED_SERVER_MAGIC ISC_MAGIC('S', 'V', 'E', 'R')
@ -421,5 +421,5 @@ named_server_getmemprof(void);
*/
isc_result_t
named_register_one_plugin(const cfg_obj_t *config, const cfg_obj_t *obj,
cfg_aclconfctx_t *actx, const char *plugin_path,
cfg_aclconfctx_t *aclctx, const char *plugin_path,
const char *parameters, void *callback_data);

View file

@ -28,7 +28,7 @@
isc_result_t
named_statschannels_configure(named_server_t *server, const cfg_obj_t *config,
cfg_aclconfctx_t *aclconfctx);
cfg_aclconfctx_t *aclctx);
/*%<
* [Re]configure the statistics channels.
*

View file

@ -24,7 +24,7 @@
isc_result_t
named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
const cfg_obj_t *zconfig, cfg_aclconfctx_t *ac,
const cfg_obj_t *zconfig, cfg_aclconfctx_t *aclctx,
dns_kasplist_t *kasplist, dns_zone_t *zone,
dns_zone_t *raw);
/*%<
@ -35,7 +35,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
* at zone creation time.
*
* Require:
* \li 'ac' to point to an initialized cfg_aclconfctx_t.
* \li 'aclctx' to point to an initialized cfg_aclconfctx_t.
* \li 'kasplist' to be initialized.
* \li 'zone' to be initialized.
*/
@ -85,7 +85,7 @@ named_zone_templateopts(const cfg_obj_t *config, const cfg_obj_t *zoptions);
isc_result_t
named_zone_loadplugins(dns_zone_t *zone, const cfg_obj_t *config,
const cfg_obj_t *toptions, const cfg_obj_t *zoptions,
cfg_aclconfctx_t *actx);
cfg_aclconfctx_t *aclctx);
/*%<
* Load plugins that should run for this specific zone. Take care of cleaning
* up any pre-existing plugins first, if the zone is re-used.
@ -96,5 +96,5 @@ named_zone_loadplugins(dns_zone_t *zone, const cfg_obj_t *config,
* \li 'zoptions' to be a valid zone configuration tree
* \li 'toptions' to be NULL or valid template configuration tree
* \li 'zoptions' to be NULL or a valid zone configuration tree
* \li 'actx' to be NULL (confcheck case only) or a valid acl conf ctx
* \li 'aclctx' to be NULL (confcheck case only) or a valid acl conf ctx
*/

View file

@ -312,7 +312,7 @@ typedef struct ns_cfgctx {
cfg_obj_t *config;
cfg_obj_t *vconfig;
cfg_obj_t *nzf_config;
cfg_aclconfctx_t *actx;
cfg_aclconfctx_t *aclctx;
} ns_cfgctx_t;
/*%
@ -472,13 +472,13 @@ listenelt_http(const cfg_obj_t *http, const uint16_t family, bool tls,
static isc_result_t
listenelt_fromconfig(const cfg_obj_t *listener, const cfg_obj_t *config,
cfg_aclconfctx_t *actx, isc_mem_t *mctx, uint16_t family,
cfg_aclconfctx_t *aclctx, isc_mem_t *mctx, uint16_t family,
isc_tlsctx_cache_t *tlsctx_cache, ns_listenelt_t **target);
static isc_result_t
listenlist_fromconfig(const cfg_obj_t *listenlist, const cfg_obj_t *config,
cfg_aclconfctx_t *actx, isc_mem_t *mctx, uint16_t family,
isc_tlsctx_cache_t *tlsctx_cache,
cfg_aclconfctx_t *aclctx, isc_mem_t *mctx,
uint16_t family, isc_tlsctx_cache_t *tlsctx_cache,
ns_listenlist_t **target);
static isc_result_t
@ -503,7 +503,7 @@ configure_zone_setviewcommit(isc_result_t result, const cfg_obj_t *zconfig,
static isc_result_t
configure_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
cfg_aclconfctx_t *actx, dns_kasplist_t *kasplist);
cfg_aclconfctx_t *aclctx, dns_kasplist_t *kasplist);
static const cfg_obj_t *
find_maplist(const cfg_obj_t *config, const char *listname, const char *name);
@ -556,7 +556,7 @@ load_nzf(dns_view_t *view, ns_cfgctx_t *nzcfg);
static isc_result_t
configure_view_acl(const cfg_obj_t *vconfig, const cfg_obj_t *config,
const cfg_obj_t *gconfig, const char *aclname,
const char *acltuplename, cfg_aclconfctx_t *actx,
const char *acltuplename, cfg_aclconfctx_t *aclctx,
isc_mem_t *mctx, dns_acl_t **aclp) {
isc_result_t result;
const cfg_obj_t *maps[4];
@ -602,7 +602,7 @@ configure_view_acl(const cfg_obj_t *vconfig, const cfg_obj_t *config,
aclobj = cfg_tuple_get(aclobj, acltuplename);
}
result = cfg_acl_fromconfig(aclobj, config, actx, mctx, 0, aclp);
result = cfg_acl_fromconfig(aclobj, config, aclctx, mctx, 0, aclp);
return result;
}
@ -2494,7 +2494,7 @@ catz_addmodzone_cb(void *arg) {
dns_view_thaw(cz->view);
result = configure_zone(cfg->config, zoneobj, cfg->vconfig, cz->view,
&cz->cbd->server->viewlist,
&cz->cbd->server->kasplist, cfg->actx, true,
&cz->cbd->server->kasplist, cfg->aclctx, true,
false, true, cz->mod);
dns_view_freeze(cz->view);
isc_loopmgr_resume();
@ -2769,7 +2769,7 @@ catz_reconfigure(dns_catz_entry_t *entry, void *arg1, void *arg2) {
result = configure_zone(data->config, zoneobj, cfg->vconfig, view,
&data->cbd->server->viewlist,
&data->cbd->server->kasplist, cfg->actx, true,
&data->cbd->server->kasplist, cfg->aclctx, true,
false, true, true);
if (result != ISC_R_SUCCESS) {
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
@ -2987,7 +2987,7 @@ cleanup:
static isc_result_t
configure_rrl(dns_view_t *view, const cfg_obj_t *config, const cfg_obj_t *map,
cfg_aclconfctx_t *actx) {
cfg_aclconfctx_t *aclctx) {
const cfg_obj_t *obj;
dns_rrl_t *rrl;
isc_result_t result;
@ -3098,7 +3098,7 @@ configure_rrl(dns_view_t *view, const cfg_obj_t *config, const cfg_obj_t *map,
obj = NULL;
result = cfg_map_get(map, "exempt-clients", &obj);
if (result == ISC_R_SUCCESS) {
result = cfg_acl_fromconfig(obj, config, actx, isc_g_mctx, 0,
result = cfg_acl_fromconfig(obj, config, aclctx, isc_g_mctx, 0,
&rrl->exempt);
CHECK_RRL(result == ISC_R_SUCCESS, "invalid %s%s",
"address match list", "");
@ -3715,7 +3715,7 @@ create_mapped_acl(void) {
isc_result_t
named_register_one_plugin(const cfg_obj_t *config, const cfg_obj_t *obj,
cfg_aclconfctx_t *actx, const char *plugin_path,
cfg_aclconfctx_t *aclctx, const char *plugin_path,
const char *parameters, void *callback_data) {
char full_path[PATH_MAX];
isc_result_t result;
@ -3734,7 +3734,7 @@ named_register_one_plugin(const cfg_obj_t *config, const cfg_obj_t *obj,
result = ns_plugin_register(full_path, parameters, config,
cfg_obj_file(obj), cfg_obj_line(obj),
isc_g_mctx, actx, hookdata);
isc_g_mctx, aclctx, hookdata);
if (result != ISC_R_SUCCESS) {
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
ISC_LOG_ERROR,
@ -3795,8 +3795,9 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
cfg_obj_t *vconfig, named_cachelist_t *cachelist,
named_cachelist_t *oldcachelist, dns_kasplist_t *kasplist,
const cfg_obj_t *bindkeys, isc_mem_t *mctx,
cfg_aclconfctx_t *actx, isc_tlsctx_cache_t *tlsctx_client_cache,
bool need_hints, bool first_time) {
cfg_aclconfctx_t *aclctx,
isc_tlsctx_cache_t *tlsctx_client_cache, bool need_hints,
bool first_time) {
const cfg_obj_t *maps[4];
const cfg_obj_t *cfgmaps[3];
const cfg_obj_t *optionmaps[3];
@ -3938,7 +3939,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
CFG_LIST_FOREACH(zonelist, element) {
const cfg_obj_t *zconfig = cfg_listelt_value(element);
CHECK(configure_zone(config, zconfig, vconfig, view, viewlist,
kasplist, actx, false, old_rpz_ok, false,
kasplist, aclctx, false, old_rpz_ok, false,
false));
zone_element_latest = element;
}
@ -3974,7 +3975,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* from the newzone file for zones that were added during previous
* runs.
*/
CHECK(configure_newzones(view, config, vconfig, actx, kasplist));
CHECK(configure_newzones(view, config, vconfig, aclctx, kasplist));
/*
* Create Dynamically Loadable Zone driver.
@ -4178,7 +4179,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
obj = NULL;
(void)cfg_map_get(map, "clients", &obj);
if (obj != NULL) {
result = cfg_acl_fromconfig(obj, config, actx,
result = cfg_acl_fromconfig(obj, config, aclctx,
mctx, 0, &clients);
if (result != ISC_R_SUCCESS) {
goto cleanup;
@ -4187,7 +4188,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
obj = NULL;
(void)cfg_map_get(map, "mapped", &obj);
if (obj != NULL) {
result = cfg_acl_fromconfig(obj, config, actx,
result = cfg_acl_fromconfig(obj, config, aclctx,
mctx, 0, &mapped);
if (result != ISC_R_SUCCESS) {
goto cleanup;
@ -4196,7 +4197,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
obj = NULL;
(void)cfg_map_get(map, "exclude", &obj);
if (obj != NULL) {
result = cfg_acl_fromconfig(obj, config, actx,
result = cfg_acl_fromconfig(obj, config, aclctx,
mctx, 0, &excluded);
if (result != ISC_R_SUCCESS) {
goto cleanup;
@ -4862,9 +4863,9 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* can be retrieved.)
*/
CHECK(configure_view_acl(vconfig, config, NULL, "match-clients", NULL,
actx, isc_g_mctx, &view->matchclients));
aclctx, isc_g_mctx, &view->matchclients));
CHECK(configure_view_acl(vconfig, config, NULL, "match-destinations",
NULL, actx, isc_g_mctx,
NULL, aclctx, isc_g_mctx,
&view->matchdestinations));
/*
@ -4969,25 +4970,25 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
/* named.conf only */
CHECK(configure_view_acl(vconfig, config, NULL, "allow-query", NULL,
actx, isc_g_mctx, &view->queryacl));
aclctx, isc_g_mctx, &view->queryacl));
/* named.conf only */
CHECK(configure_view_acl(vconfig, config, NULL, "allow-query-cache",
NULL, actx, isc_g_mctx, &view->cacheacl));
NULL, aclctx, isc_g_mctx, &view->cacheacl));
/* named.conf only */
CHECK(configure_view_acl(vconfig, config, NULL, "allow-query-cache-on",
NULL, actx, isc_g_mctx, &view->cacheonacl));
NULL, aclctx, isc_g_mctx, &view->cacheonacl));
CHECK(configure_view_acl(vconfig, config, named_g_defaultconfig,
"allow-query-on", NULL, actx, isc_g_mctx,
"allow-query-on", NULL, aclctx, isc_g_mctx,
&view->queryonacl));
CHECK(configure_view_acl(vconfig, config, named_g_defaultconfig,
"allow-proxy", NULL, actx, isc_g_mctx,
"allow-proxy", NULL, aclctx, isc_g_mctx,
&view->proxyacl));
CHECK(configure_view_acl(vconfig, config, named_g_defaultconfig,
"allow-proxy-on", NULL, actx, isc_g_mctx,
"allow-proxy-on", NULL, aclctx, isc_g_mctx,
&view->proxyonacl));
if (strcmp(view->name, "_bind") != 0 &&
@ -4995,11 +4996,11 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
{
/* named.conf only */
CHECK(configure_view_acl(vconfig, config, NULL,
"allow-recursion", NULL, actx,
"allow-recursion", NULL, aclctx,
isc_g_mctx, &view->recursionacl));
/* named.conf only */
CHECK(configure_view_acl(vconfig, config, NULL,
"allow-recursion-on", NULL, actx,
"allow-recursion-on", NULL, aclctx,
isc_g_mctx, &view->recursiononacl));
}
@ -5062,29 +5063,29 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
/* global default only */
CHECK(configure_view_acl(
NULL, NULL, named_g_defaultconfig,
"allow-recursion", NULL, actx, isc_g_mctx,
"allow-recursion", NULL, aclctx, isc_g_mctx,
&view->recursionacl));
}
if (view->recursiononacl == NULL) {
/* global default only */
CHECK(configure_view_acl(
NULL, NULL, named_g_defaultconfig,
"allow-recursion-on", NULL, actx, isc_g_mctx,
"allow-recursion-on", NULL, aclctx, isc_g_mctx,
&view->recursiononacl));
}
if (view->cacheacl == NULL) {
/* global default only */
CHECK(configure_view_acl(
NULL, NULL, named_g_defaultconfig,
"allow-query-cache", NULL, actx, isc_g_mctx,
"allow-query-cache", NULL, aclctx, isc_g_mctx,
&view->cacheacl));
}
if (view->cacheonacl == NULL) {
/* global default only */
CHECK(configure_view_acl(
NULL, NULL, named_g_defaultconfig,
"allow-query-cache-on", NULL, actx, isc_g_mctx,
&view->cacheonacl));
"allow-query-cache-on", NULL, aclctx,
isc_g_mctx, &view->cacheonacl));
}
} else {
/*
@ -5106,8 +5107,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
if (view->queryacl == NULL) {
/* global default only */
CHECK(configure_view_acl(NULL, NULL, named_g_defaultconfig,
"allow-query", NULL, actx, isc_g_mctx,
&view->queryacl));
"allow-query", NULL, aclctx,
isc_g_mctx, &view->queryacl));
}
/*
@ -5116,7 +5117,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* and is needed by some broken clients.
*/
CHECK(configure_view_acl(vconfig, config, named_g_defaultconfig,
"no-case-compress", NULL, actx, isc_g_mctx,
"no-case-compress", NULL, aclctx, isc_g_mctx,
&view->nocasecompress));
/*
@ -5132,7 +5133,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
* Filter setting on addresses in the answer section.
*/
CHECK(configure_view_acl(vconfig, config, named_g_defaultconfig,
"deny-answer-addresses", "acl", actx,
"deny-answer-addresses", "acl", aclctx,
isc_g_mctx, &view->denyansweracl));
CHECK(configure_view_nametable(vconfig, config, "deny-answer-addresses",
"except-from", isc_g_mctx,
@ -5156,13 +5157,13 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
*/
if (view->updateacl == NULL) {
CHECK(configure_view_acl(NULL, NULL, named_g_defaultconfig,
"allow-update", NULL, actx, isc_g_mctx,
&view->updateacl));
"allow-update", NULL, aclctx,
isc_g_mctx, &view->updateacl));
}
if (view->upfwdacl == NULL) {
CHECK(configure_view_acl(NULL, NULL, named_g_defaultconfig,
"allow-update-forwarding", NULL, actx,
isc_g_mctx, &view->upfwdacl));
"allow-update-forwarding", NULL,
aclctx, isc_g_mctx, &view->upfwdacl));
}
/*
@ -5171,13 +5172,13 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
*/
if (view->transferacl == NULL) {
CHECK(configure_view_acl(vconfig, config, named_g_defaultconfig,
"allow-transfer", NULL, actx,
"allow-transfer", NULL, aclctx,
isc_g_mctx, &view->transferacl));
}
if (view->notifyacl == NULL) {
CHECK(configure_view_acl(vconfig, config, named_g_defaultconfig,
"allow-notify", NULL, actx, isc_g_mctx,
&view->notifyacl));
"allow-notify", NULL, aclctx,
isc_g_mctx, &view->notifyacl));
}
obj = NULL;
@ -5217,7 +5218,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
padding = 512U;
}
view->padding = (uint16_t)padding;
CHECK(cfg_acl_fromconfig(aclobj, config, actx, isc_g_mctx, 0,
CHECK(cfg_acl_fromconfig(aclobj, config, aclctx, isc_g_mctx, 0,
&view->pad_acl));
}
@ -5431,7 +5432,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
view->plugins = hookdata.plugins;
view->plugins_free = ns_plugins_free;
CHECK(cfg_pluginlist_foreach(config, plugin_list, actx,
CHECK(cfg_pluginlist_foreach(config, plugin_list, aclctx,
named_register_one_plugin,
&hookdata));
}
@ -5688,7 +5689,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
obj = NULL;
result = named_config_get(maps, "rate-limit", &obj);
if (result == ISC_R_SUCCESS) {
result = configure_rrl(view, config, obj, actx);
result = configure_rrl(view, config, obj, aclctx);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
@ -6256,7 +6257,7 @@ static isc_result_t
configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
const cfg_obj_t *vconfig, dns_view_t *view,
dns_viewlist_t *viewlist, dns_kasplist_t *kasplist,
cfg_aclconfctx_t *actx, bool added, bool old_rpz_ok,
cfg_aclconfctx_t *aclctx, bool added, bool old_rpz_ok,
bool is_catz_member, bool modify) {
dns_view_t *pview = NULL; /* Production view */
dns_zone_t *zone = NULL; /* New or reused zone */
@ -6456,7 +6457,7 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
zone));
dns_zone_setstats(zone, named_g_server->zonestats);
}
CHECK(named_zone_configure(config, vconfig, zconfig, actx,
CHECK(named_zone_configure(config, vconfig, zconfig, aclctx,
kasplist, zone, NULL));
dns_zone_attach(zone, &view->redirect);
goto cleanup;
@ -6632,7 +6633,7 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
/*
* Configure the zone.
*/
CHECK(named_zone_configure(config, vconfig, zconfig, actx, kasplist,
CHECK(named_zone_configure(config, vconfig, zconfig, aclctx, kasplist,
zone, raw));
/*
@ -6663,7 +6664,8 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
dns_zone_rekey(zone, fullsign, false);
}
result = named_zone_loadplugins(zone, config, toptions, zoptions, actx);
result = named_zone_loadplugins(zone, config, toptions, zoptions,
aclctx);
cleanup:
if (zone != NULL) {
@ -7333,7 +7335,7 @@ cleanup:
static isc_result_t
setup_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
cfg_parser_t *config_parser, cfg_aclconfctx_t *actx) {
cfg_parser_t *config_parser, cfg_aclconfctx_t *aclctx) {
isc_result_t result = ISC_R_SUCCESS;
bool allow = false;
ns_cfgctx_t *nzcfg = NULL;
@ -7442,12 +7444,12 @@ setup_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
isc_mem_attach(view->mctx, &nzcfg->mctx);
cfg_parser_attach(config_parser, &nzcfg->conf_parser);
cfg_parser_attach(named_g_addparser, &nzcfg->add_parser);
cfg_aclconfctx_attach(actx, &nzcfg->actx);
cfg_aclconfctx_attach(aclctx, &nzcfg->aclctx);
result = dns_view_setnewzones(view, true, nzcfg, newzone_cfgctx_destroy,
mapsize);
if (result != ISC_R_SUCCESS) {
cfg_aclconfctx_detach(&nzcfg->actx);
cfg_aclconfctx_detach(&nzcfg->aclctx);
cfg_parser_destroy(&nzcfg->conf_parser);
cfg_parser_destroy(&nzcfg->add_parser);
isc_mem_putanddetach(&nzcfg->mctx, nzcfg, sizeof(*nzcfg));
@ -7508,7 +7510,7 @@ configure_zone_setviewcommit(isc_result_t result, const cfg_obj_t *zconfig,
static isc_result_t
configure_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
cfg_aclconfctx_t *actx, dns_kasplist_t *kasplist) {
cfg_aclconfctx_t *aclctx, dns_kasplist_t *kasplist) {
isc_result_t result;
ns_cfgctx_t *nzctx = NULL;
const cfg_obj_t *zonelist = NULL;
@ -7528,8 +7530,8 @@ configure_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
CFG_LIST_FOREACH(zonelist, element) {
const cfg_obj_t *zconfig = cfg_listelt_value(element);
CHECK(configure_zone(config, zconfig, vconfig, view,
&named_g_server->viewlist, kasplist, actx,
true, false, false, false));
&named_g_server->viewlist, kasplist,
aclctx, true, false, false, false));
}
result = ISC_R_SUCCESS;
@ -7622,13 +7624,13 @@ cleanup:
typedef isc_result_t (*newzone_cfg_cb_t)(const cfg_obj_t *zconfig,
cfg_obj_t *config, cfg_obj_t *vconfig,
dns_view_t *view,
cfg_aclconfctx_t *actx,
cfg_aclconfctx_t *aclctx,
dns_kasplist_t *kasplist);
/*%
* For each zone found in a NZD opened by the caller, create an object
* representing its configuration and invoke "callback" with the created
* object, "config", "vconfig", "mctx", "view" and "actx" as arguments (all
* object, "config", "vconfig", "mctx", "view" and "aclctx" as arguments (all
* these are non-global variables required to invoke configure_zone()).
* Immediately interrupt processing if an error is encountered while
* transforming NZD data into a zone configuration object or if "callback"
@ -7639,7 +7641,7 @@ typedef isc_result_t (*newzone_cfg_cb_t)(const cfg_obj_t *zconfig,
static isc_result_t
for_all_newzone_cfgs(newzone_cfg_cb_t callback, cfg_obj_t *config,
cfg_obj_t *vconfig, dns_view_t *view,
cfg_aclconfctx_t *actx, dns_kasplist_t *kasplist,
cfg_aclconfctx_t *aclctx, dns_kasplist_t *kasplist,
MDB_txn *txn, MDB_dbi dbi) {
const cfg_obj_t *zconfig, *zlist;
isc_result_t result = ISC_R_SUCCESS;
@ -7682,7 +7684,7 @@ for_all_newzone_cfgs(newzone_cfg_cb_t callback, cfg_obj_t *config,
/*
* Invoke callback.
*/
result = callback(zconfig, config, vconfig, view, actx,
result = callback(zconfig, config, vconfig, view, aclctx,
kasplist);
if (result != ISC_R_SUCCESS) {
break;
@ -7710,10 +7712,10 @@ for_all_newzone_cfgs(newzone_cfg_cb_t callback, cfg_obj_t *config,
*/
static isc_result_t
configure_newzone(const cfg_obj_t *zconfig, cfg_obj_t *config,
cfg_obj_t *vconfig, dns_view_t *view, cfg_aclconfctx_t *actx,
dns_kasplist_t *kasplist) {
cfg_obj_t *vconfig, dns_view_t *view,
cfg_aclconfctx_t *aclctx, dns_kasplist_t *kasplist) {
return configure_zone(config, zconfig, vconfig, view,
&named_g_server->viewlist, kasplist, actx, true,
&named_g_server->viewlist, kasplist, aclctx, true,
false, false, false);
}
@ -7723,10 +7725,10 @@ configure_newzone(const cfg_obj_t *zconfig, cfg_obj_t *config,
static isc_result_t
configure_newzone_revert(const cfg_obj_t *zconfig, cfg_obj_t *config,
cfg_obj_t *vconfig, dns_view_t *view,
cfg_aclconfctx_t *actx, dns_kasplist_t *kasplist) {
cfg_aclconfctx_t *aclctx, dns_kasplist_t *kasplist) {
UNUSED(config);
UNUSED(vconfig);
UNUSED(actx);
UNUSED(aclctx);
UNUSED(kasplist);
configure_zone_setviewcommit(ISC_R_FAILURE, zconfig, view);
@ -7736,7 +7738,7 @@ configure_newzone_revert(const cfg_obj_t *zconfig, cfg_obj_t *config,
static isc_result_t
configure_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
cfg_aclconfctx_t *actx, dns_kasplist_t *kasplist) {
cfg_aclconfctx_t *aclctx, dns_kasplist_t *kasplist) {
isc_result_t result;
MDB_txn *txn = NULL;
MDB_dbi dbi;
@ -7760,7 +7762,7 @@ configure_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
view->new_zone_db, view->name);
result = for_all_newzone_cfgs(configure_newzone, config, vconfig, view,
actx, kasplist, txn, dbi);
aclctx, kasplist, txn, dbi);
if (result != ISC_R_SUCCESS) {
/*
* An error was encountered while attempting to configure zones
@ -7771,7 +7773,7 @@ configure_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
* terms of trying to make things right.
*/
(void)for_all_newzone_cfgs(configure_newzone_revert, config,
vconfig, view, actx, kasplist, txn,
vconfig, view, aclctx, kasplist, txn,
dbi);
}
@ -7852,8 +7854,8 @@ cleanup:
ISC_LOG_DEBUG(1), "apply_configuration: %s", __func__);
static isc_result_t
create_views(cfg_obj_t *config, cfg_parser_t *parser,
cfg_aclconfctx_t *aclconfctx, dns_viewlist_t *viewlist) {
create_views(cfg_obj_t *config, cfg_parser_t *parser, cfg_aclconfctx_t *aclctx,
dns_viewlist_t *viewlist) {
isc_result_t result = ISC_R_SUCCESS;
const cfg_obj_t *views = NULL;
@ -7870,8 +7872,7 @@ create_views(cfg_obj_t *config, cfg_parser_t *parser,
}
INSIST(view != NULL);
result = setup_newzones(view, config, vconfig, parser,
aclconfctx);
result = setup_newzones(view, config, vconfig, parser, aclctx);
dns_view_detach(&view);
if (result != ISC_R_SUCCESS) {
@ -7892,7 +7893,7 @@ create_views(cfg_obj_t *config, cfg_parser_t *parser,
}
INSIST(view != NULL);
result = setup_newzones(view, config, NULL, parser, aclconfctx);
result = setup_newzones(view, config, NULL, parser, aclctx);
dns_view_detach(&view);
}
@ -7902,7 +7903,7 @@ create_views(cfg_obj_t *config, cfg_parser_t *parser,
static isc_result_t
configure_views(cfg_obj_t *config, const cfg_obj_t *bindkeys,
cfg_aclconfctx_t *aclconfctx,
cfg_aclconfctx_t *aclctx,
isc_tlsctx_cache_t *tlsctx_client_cache,
dns_viewlist_t *viewlist, named_cachelist_t *cachelist,
dns_kasplist_t *kasplist, named_server_t *server,
@ -7930,7 +7931,7 @@ configure_views(cfg_obj_t *config, const cfg_obj_t *bindkeys,
result = configure_view(view, viewlist, config, vconfig,
cachelist, &server->cachelist, kasplist,
bindkeys, isc_g_mctx, aclconfctx,
bindkeys, isc_g_mctx, aclctx,
tlsctx_client_cache, true, first_time);
if (result != ISC_R_SUCCESS) {
dns_view_detach(&view);
@ -7952,8 +7953,8 @@ configure_views(cfg_obj_t *config, const cfg_obj_t *bindkeys,
}
result = configure_view(view, viewlist, config, NULL, cachelist,
&server->cachelist, kasplist, bindkeys,
isc_g_mctx, aclconfctx,
tlsctx_client_cache, true, first_time);
isc_g_mctx, aclctx, tlsctx_client_cache,
true, first_time);
if (result != ISC_R_SUCCESS) {
dns_view_detach(&view);
return result;
@ -7979,7 +7980,7 @@ configure_views(cfg_obj_t *config, const cfg_obj_t *bindkeys,
result = configure_view(view, viewlist, config, vconfig,
cachelist, &server->cachelist, kasplist,
bindkeys, isc_g_mctx, aclconfctx,
bindkeys, isc_g_mctx, aclctx,
tlsctx_client_cache, false, first_time);
if (result != ISC_R_SUCCESS) {
dns_view_detach(&view);
@ -8144,7 +8145,7 @@ apply_configuration(cfg_parser_t *configparser, cfg_obj_t *config,
bool exclusive = true;
dns_aclenv_t *env =
ns_interfacemgr_getaclenv(named_g_server->interfacemgr);
cfg_aclconfctx_t *tmpaclconfctx, *aclconfctx = NULL;
cfg_aclconfctx_t *tmpaclctx, *aclctx = NULL;
isc_tlsctx_cache_t *tlsctx_client_cache = NULL;
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
@ -8174,9 +8175,9 @@ apply_configuration(cfg_parser_t *configparser, cfg_obj_t *config,
maps[i] = NULL;
/* Create the ACL configuration context */
result = cfg_aclconfctx_create(isc_g_mctx, &aclconfctx);
result = cfg_aclconfctx_create(isc_g_mctx, &aclctx);
if (result != ISC_R_SUCCESS) {
goto cleanup_aclconfctx;
goto cleanup_aclctx;
}
result = configure_keystores(config, &keystorelist);
@ -8189,7 +8190,7 @@ apply_configuration(cfg_parser_t *configparser, cfg_obj_t *config,
goto cleanup_kasplist;
}
result = create_views(config, configparser, aclconfctx, &viewlist);
result = create_views(config, configparser, aclctx, &viewlist);
if (result != ISC_R_SUCCESS) {
goto cleanup_viewlist;
}
@ -8308,7 +8309,7 @@ apply_configuration(cfg_parser_t *configparser, cfg_obj_t *config,
char *dir = UNCONST(cfg_obj_asstring(obj));
named_geoip_load(dir);
}
aclconfctx->geoip = named_g_geoip;
aclctx->geoip = named_g_geoip;
#endif /* HAVE_GEOIP2 */
/*
@ -8346,7 +8347,7 @@ apply_configuration(cfg_parser_t *configparser, cfg_obj_t *config,
result = named_config_get(maps, "sig0checks-quota-exempt", &obj);
if (result == ISC_R_SUCCESS) {
result = cfg_acl_fromconfig(
obj, config, aclconfctx, isc_g_mctx, 0,
obj, config, aclctx, isc_g_mctx, 0,
&server->sctx->sig0checksquota_exempt);
INSIST(result == ISC_R_SUCCESS);
}
@ -8356,7 +8357,7 @@ apply_configuration(cfg_parser_t *configparser, cfg_obj_t *config,
* no default.
*/
result = configure_view_acl(NULL, config, NULL, "blackhole", NULL,
aclconfctx, isc_g_mctx,
aclctx, isc_g_mctx,
&server->sctx->blackholeacl);
if (result != ISC_R_SUCCESS) {
goto cleanup_bindkeys_parser;
@ -8658,7 +8659,7 @@ apply_configuration(cfg_parser_t *configparser, cfg_obj_t *config,
goto cleanup_portsets;
}
result = listenlist_fromconfig(
clistenon, config, aclconfctx, isc_g_mctx, AF_INET,
clistenon, config, aclctx, isc_g_mctx, AF_INET,
server->tlsctx_server_cache, &listenon);
if (result != ISC_R_SUCCESS) {
goto cleanup_portsets;
@ -8682,7 +8683,7 @@ apply_configuration(cfg_parser_t *configparser, cfg_obj_t *config,
goto cleanup_portsets;
}
result = listenlist_fromconfig(
clistenon, config, aclconfctx, isc_g_mctx, AF_INET6,
clistenon, config, aclctx, isc_g_mctx, AF_INET6,
server->tlsctx_server_cache, &listenon);
if (result != ISC_R_SUCCESS) {
goto cleanup_portsets;
@ -8804,9 +8805,9 @@ apply_configuration(cfg_parser_t *configparser, cfg_obj_t *config,
*/
(void)configure_session_key(maps, server, isc_g_mctx, first_time);
result = configure_views(config, bindkeys, aclconfctx,
tlsctx_client_cache, &viewlist, &cachelist,
&kasplist, server, first_time);
result = configure_views(config, bindkeys, aclctx, tlsctx_client_cache,
&viewlist, &cachelist, &kasplist, server,
first_time);
if (result != ISC_R_SUCCESS) {
goto cleanup_cachelist;
}
@ -9202,9 +9203,9 @@ apply_configuration(cfg_parser_t *configparser, cfg_obj_t *config,
/*
* Swap server aclconfctx
*/
tmpaclconfctx = server->aclconfctx;
server->aclconfctx = aclconfctx;
aclconfctx = tmpaclconfctx;
tmpaclctx = server->aclctx;
server->aclctx = aclctx;
aclctx = tmpaclctx;
/*
* Swap client TLS context
@ -9234,7 +9235,7 @@ apply_configuration(cfg_parser_t *configparser, cfg_obj_t *config,
/* Configure the statistics channel(s) */
result = named_statschannels_configure(named_g_server, config,
server->aclconfctx);
server->aclctx);
if (result != ISC_R_SUCCESS) {
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
ISC_LOG_ERROR,
@ -9247,7 +9248,7 @@ apply_configuration(cfg_parser_t *configparser, cfg_obj_t *config,
* Bind the control port(s).
*/
result = named_controls_configure(named_g_server->controls, config,
server->aclconfctx);
server->aclctx);
if (result != ISC_R_SUCCESS) {
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
ISC_LOG_ERROR, "binding control channel(s): %s",
@ -9332,9 +9333,9 @@ cleanup_keystorelist:
dns_keystore_detach(&keystore);
}
cleanup_aclconfctx:
if (aclconfctx != NULL) {
cfg_aclconfctx_detach(&aclconfctx);
cleanup_aclctx:
if (aclctx != NULL) {
cfg_aclconfctx_detach(&aclctx);
}
isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER,
@ -9606,8 +9607,8 @@ shutdown_server(void *arg) {
cleanup_session_key(server, server->mctx);
if (server->aclconfctx != NULL) {
cfg_aclconfctx_detach(&server->aclconfctx);
if (server->aclctx != NULL) {
cfg_aclconfctx_detach(&server->aclctx);
}
cfg_obj_destroy(named_g_parser, &named_g_defaultconfig);
@ -10722,8 +10723,8 @@ named_server_setortoggle(named_server_t *server, const char *optname,
static isc_result_t
listenlist_fromconfig(const cfg_obj_t *listenlist, const cfg_obj_t *config,
cfg_aclconfctx_t *actx, isc_mem_t *mctx, uint16_t family,
isc_tlsctx_cache_t *tlsctx_cache,
cfg_aclconfctx_t *aclctx, isc_mem_t *mctx,
uint16_t family, isc_tlsctx_cache_t *tlsctx_cache,
ns_listenlist_t **target) {
isc_result_t result;
ns_listenlist_t *dlist = NULL;
@ -10738,7 +10739,7 @@ listenlist_fromconfig(const cfg_obj_t *listenlist, const cfg_obj_t *config,
CFG_LIST_FOREACH(listenlist, element) {
ns_listenelt_t *delt = NULL;
const cfg_obj_t *listener = cfg_listelt_value(element);
result = listenelt_fromconfig(listener, config, actx, mctx,
result = listenelt_fromconfig(listener, config, aclctx, mctx,
family, tlsctx_cache, &delt);
if (result != ISC_R_SUCCESS) {
goto cleanup;
@ -10784,7 +10785,7 @@ find_maplist(const cfg_obj_t *config, const char *listname, const char *name) {
*/
static isc_result_t
listenelt_fromconfig(const cfg_obj_t *listener, const cfg_obj_t *config,
cfg_aclconfctx_t *actx, isc_mem_t *mctx, uint16_t family,
cfg_aclconfctx_t *aclctx, isc_mem_t *mctx, uint16_t family,
isc_tlsctx_cache_t *tlsctx_cache,
ns_listenelt_t **target) {
isc_result_t result;
@ -11022,7 +11023,7 @@ listenelt_fromconfig(const cfg_obj_t *listener, const cfg_obj_t *config,
}
result = cfg_acl_fromconfig(cfg_tuple_get(listener, "acl"), config,
actx, mctx, family, &delt->acl);
aclctx, mctx, family, &delt->acl);
if (result != ISC_R_SUCCESS) {
ns_listenelt_destroy(delt);
return result;
@ -13297,7 +13298,7 @@ do_addzone(named_server_t *server, ns_cfgctx_t *cfg, dns_view_t *view,
result = isccfg_check_zoneconf(zoneobj, voptions, cfg->config, NULL,
NULL, NULL, NULL, view->name,
view->rdclass, BIND_CHECK_PLUGINS,
cfg->actx, cfg->mctx);
cfg->aclctx, cfg->mctx);
if (result != ISC_R_SUCCESS) {
isc_loopmgr_resume();
goto cleanup;
@ -13306,8 +13307,8 @@ do_addzone(named_server_t *server, ns_cfgctx_t *cfg, dns_view_t *view,
/* Mark view unfrozen and configure zone */
dns_view_thaw(view);
result = configure_zone(cfg->config, zoneobj, cfg->vconfig, view,
&server->viewlist, &server->kasplist, cfg->actx,
true, false, false, false);
&server->viewlist, &server->kasplist,
cfg->aclctx, true, false, false, false);
dns_view_freeze(view);
isc_loopmgr_resume();
@ -13495,7 +13496,7 @@ do_modzone(named_server_t *server, ns_cfgctx_t *cfg, dns_view_t *view,
result = isccfg_check_zoneconf(zoneobj, voptions, cfg->config, NULL,
NULL, NULL, NULL, view->name,
view->rdclass, BIND_CHECK_PLUGINS,
cfg->actx, cfg->mctx);
cfg->aclctx, cfg->mctx);
if (result != ISC_R_SUCCESS) {
isc_loopmgr_resume();
goto cleanup;
@ -13504,8 +13505,8 @@ do_modzone(named_server_t *server, ns_cfgctx_t *cfg, dns_view_t *view,
/* Reconfigure the zone */
dns_view_thaw(view);
result = configure_zone(cfg->config, zoneobj, cfg->vconfig, view,
&server->viewlist, &server->kasplist, cfg->actx,
true, false, false, true);
&server->viewlist, &server->kasplist,
cfg->aclctx, true, false, false, true);
dns_view_freeze(view);
isc_loopmgr_resume();
@ -14256,8 +14257,8 @@ newzone_cfgctx_destroy(void **cfgp) {
cfg_parser_destroy(&cfg->add_parser);
}
if (cfg->actx != NULL) {
cfg_aclconfctx_detach(&cfg->actx);
if (cfg->aclctx != NULL) {
cfg_aclconfctx_detach(&cfg->aclctx);
}
isc_mem_putanddetach(&cfg->mctx, cfg, sizeof(*cfg));

View file

@ -3621,7 +3621,7 @@ destroy_listener(void *arg) {
static isc_result_t
add_listener(named_server_t *server, named_statschannel_t **listenerp,
const cfg_obj_t *listen_params, const cfg_obj_t *config,
isc_sockaddr_t *addr, cfg_aclconfctx_t *aclconfctx,
isc_sockaddr_t *addr, cfg_aclconfctx_t *aclctx,
const char *socktext) {
#if !defined(HAVE_LIBXML2) && !defined(HAVE_JSON_C)
UNUSED(server);
@ -3629,7 +3629,7 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
UNUSED(listen_params);
UNUSED(config);
UNUSED(addr);
UNUSED(aclconfctx);
UNUSED(aclctx);
UNUSED(socktext);
return ISC_R_NOTIMPLEMENTED;
@ -3648,7 +3648,7 @@ add_listener(named_server_t *server, named_statschannel_t **listenerp,
allow = cfg_tuple_get(listen_params, "allow");
if (allow != NULL && cfg_obj_islist(allow)) {
result = cfg_acl_fromconfig(allow, config, aclconfctx,
result = cfg_acl_fromconfig(allow, config, aclctx,
listener->mctx, 0, &new_acl);
} else {
result = dns_acl_any(listener->mctx, &new_acl);
@ -3751,7 +3751,7 @@ cleanup:
static void
update_listener(named_server_t *server, named_statschannel_t **listenerp,
const cfg_obj_t *listen_params, const cfg_obj_t *config,
isc_sockaddr_t *addr, cfg_aclconfctx_t *aclconfctx,
isc_sockaddr_t *addr, cfg_aclconfctx_t *aclctx,
const char *socktext) {
named_statschannel_t *listener = NULL;
const cfg_obj_t *allow = NULL;
@ -3775,7 +3775,7 @@ update_listener(named_server_t *server, named_statschannel_t **listenerp,
*/
allow = cfg_tuple_get(listen_params, "allow");
if (allow != NULL && cfg_obj_islist(allow)) {
result = cfg_acl_fromconfig(allow, config, aclconfctx,
result = cfg_acl_fromconfig(allow, config, aclctx,
listener->mctx, 0, &new_acl);
} else {
result = dns_acl_any(listener->mctx, &new_acl);
@ -3801,7 +3801,7 @@ update_listener(named_server_t *server, named_statschannel_t **listenerp,
isc_result_t
named_statschannels_configure(named_server_t *server, const cfg_obj_t *config,
cfg_aclconfctx_t *aclconfctx) {
cfg_aclconfctx_t *aclctx) {
named_statschannellist_t new_listeners;
const cfg_obj_t *statschannellist = NULL;
char socktext[ISC_SOCKADDR_FORMATSIZE];
@ -3882,7 +3882,7 @@ named_statschannels_configure(named_server_t *server, const cfg_obj_t *config,
update_listener(server, &listener,
listen_params, config, &addr,
aclconfctx, socktext);
aclctx, socktext);
if (listener != NULL) {
/*
@ -3899,7 +3899,7 @@ named_statschannels_configure(named_server_t *server, const cfg_obj_t *config,
r = add_listener(server, &listener,
listen_params, config,
&addr, aclconfctx,
&addr, aclctx,
socktext);
if (r != ISC_R_SUCCESS) {
cfg_obj_log(

View file

@ -74,7 +74,7 @@ typedef enum {
static isc_result_t
configure_zone_acl(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
const cfg_obj_t *config, acl_type_t acltype,
cfg_aclconfctx_t *actx, dns_zone_t *zone,
cfg_aclconfctx_t *aclctx, dns_zone_t *zone,
void (*setzacl)(dns_zone_t *, dns_acl_t *),
void (*clearzacl)(dns_zone_t *)) {
isc_result_t result;
@ -176,7 +176,8 @@ configure_zone_acl(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
}
parse_acl:
result = cfg_acl_fromconfig(aclobj, config, actx, isc_g_mctx, 0, &acl);
result = cfg_acl_fromconfig(aclobj, config, aclctx, isc_g_mctx, 0,
&acl);
if (result != ISC_R_SUCCESS) {
return result;
}
@ -870,7 +871,7 @@ process_notifytype(dns_notifytype_t ntype, dns_zonetype_t ztype,
isc_result_t
named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
const cfg_obj_t *zconfig, cfg_aclconfctx_t *ac,
const cfg_obj_t *zconfig, cfg_aclconfctx_t *aclctx,
dns_kasplist_t *kasplist, dns_zone_t *zone,
dns_zone_t *raw) {
isc_result_t result;
@ -1102,19 +1103,20 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
*/
if (ztype == dns_zone_secondary || ztype == dns_zone_mirror) {
CHECK(configure_zone_acl(zconfig, vconfig, config, allow_notify,
ac, mayberaw, dns_zone_setnotifyacl,
aclctx, mayberaw,
dns_zone_setnotifyacl,
dns_zone_clearnotifyacl));
}
/*
* XXXAG This probably does not make sense for stubs.
*/
CHECK(configure_zone_acl(zconfig, vconfig, config, allow_query, ac,
CHECK(configure_zone_acl(zconfig, vconfig, config, allow_query, aclctx,
zone, dns_zone_setqueryacl,
dns_zone_clearqueryacl));
CHECK(configure_zone_acl(zconfig, vconfig, config, allow_query_on, ac,
zone, dns_zone_setqueryonacl,
CHECK(configure_zone_acl(zconfig, vconfig, config, allow_query_on,
aclctx, zone, dns_zone_setqueryonacl,
dns_zone_clearqueryonacl));
obj = NULL;
@ -1286,7 +1288,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_zone_setisself(zone, isself, NULL);
CHECK(configure_zone_acl(
zconfig, vconfig, config, allow_transfer, ac, zone,
zconfig, vconfig, config, allow_transfer, aclctx, zone,
dns_zone_setxfracl, dns_zone_clearxfracl));
obj = NULL;
@ -1540,7 +1542,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
dns_acl_t *updateacl;
CHECK(configure_zone_acl(zconfig, vconfig, config, allow_update,
ac, mayberaw, dns_zone_setupdateacl,
aclctx, mayberaw,
dns_zone_setupdateacl,
dns_zone_clearupdateacl));
updateacl = dns_zone_getupdateacl(mayberaw);
@ -1618,8 +1621,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
if (ztype == dns_zone_secondary || ztype == dns_zone_mirror) {
CHECK(configure_zone_acl(zconfig, vconfig, config,
allow_update_forwarding, ac, mayberaw,
dns_zone_setforwardacl,
allow_update_forwarding, aclctx,
mayberaw, dns_zone_setforwardacl,
dns_zone_clearforwardacl));
}
@ -2102,7 +2105,7 @@ named_zone_templateopts(const cfg_obj_t *config, const cfg_obj_t *zoptions) {
isc_result_t
named_zone_loadplugins(dns_zone_t *zone, const cfg_obj_t *config,
const cfg_obj_t *toptions, const cfg_obj_t *zoptions,
cfg_aclconfctx_t *actx) {
cfg_aclconfctx_t *aclctx) {
isc_result_t result = ISC_R_SUCCESS;
const cfg_obj_t *zpluginlist = NULL;
const cfg_obj_t *tpluginlist = NULL;
@ -2136,14 +2139,14 @@ named_zone_loadplugins(dns_zone_t *zone, const cfg_obj_t *config,
ns_plugins_create(zmctx, &hookdata.plugins);
dns_zone_setplugins(zone, hookdata.plugins, ns_plugins_free);
result = cfg_pluginlist_foreach(config, tpluginlist, actx,
result = cfg_pluginlist_foreach(config, tpluginlist, aclctx,
named_register_one_plugin,
&hookdata);
if (result != ISC_R_SUCCESS) {
return result;
}
result = cfg_pluginlist_foreach(config, zpluginlist, actx,
result = cfg_pluginlist_foreach(config, zpluginlist, aclctx,
named_register_one_plugin,
&hookdata);
}

View file

@ -230,7 +230,7 @@ parse_filter_a_on(const cfg_obj_t *param_obj, const char *param_name,
}
static isc_result_t
check_syntax(cfg_obj_t *fmap, const void *cfg, isc_mem_t *mctx, void *actx) {
check_syntax(cfg_obj_t *fmap, const void *cfg, isc_mem_t *mctx, void *aclctx) {
isc_result_t result = ISC_R_SUCCESS;
const cfg_obj_t *aclobj = NULL;
dns_acl_t *acl = NULL;
@ -242,7 +242,7 @@ check_syntax(cfg_obj_t *fmap, const void *cfg, isc_mem_t *mctx, void *actx) {
}
CHECK(cfg_acl_fromconfig(aclobj, (const cfg_obj_t *)cfg,
(cfg_aclconfctx_t *)actx, mctx, 0, &acl));
(cfg_aclconfctx_t *)aclctx, mctx, 0, &acl));
CHECK(parse_filter_a_on(fmap, "filter-a-on-v6", &f6));
CHECK(parse_filter_a_on(fmap, "filter-a-on-v4", &f4));
@ -272,7 +272,7 @@ cleanup:
static isc_result_t
parse_parameters(filter_instance_t *inst, const char *parameters,
const void *cfg, const char *cfg_file, unsigned long cfg_line,
isc_mem_t *mctx, void *actx) {
isc_mem_t *mctx, void *aclctx) {
isc_result_t result = ISC_R_SUCCESS;
cfg_parser_t *parser = NULL;
cfg_obj_t *param_obj = NULL;
@ -286,7 +286,7 @@ parse_parameters(filter_instance_t *inst, const char *parameters,
CHECK(cfg_parse_buffer(parser, &b, cfg_file, cfg_line,
&cfg_type_parameters, 0, &param_obj));
CHECK(check_syntax(param_obj, cfg, mctx, actx));
CHECK(check_syntax(param_obj, cfg, mctx, aclctx));
CHECK(parse_filter_a_on(param_obj, "filter-a-on-v6", &inst->v6_a));
CHECK(parse_filter_a_on(param_obj, "filter-a-on-v4", &inst->v4_a));
@ -294,7 +294,7 @@ parse_parameters(filter_instance_t *inst, const char *parameters,
result = cfg_map_get(param_obj, "filter-a", &obj);
if (result == ISC_R_SUCCESS) {
CHECK(cfg_acl_fromconfig(obj, (const cfg_obj_t *)cfg,
(cfg_aclconfctx_t *)actx, mctx, 0,
(cfg_aclconfctx_t *)aclctx, mctx, 0,
&inst->a_acl));
} else {
CHECK(dns_acl_any(mctx, &inst->a_acl));
@ -325,7 +325,7 @@ cleanup:
*/
isc_result_t
plugin_register(const char *parameters, const void *cfg, const char *cfg_file,
unsigned long cfg_line, isc_mem_t *mctx, void *actx,
unsigned long cfg_line, isc_mem_t *mctx, void *aclctx,
ns_hooktable_t *hooktable, ns_hooksource_t source,
void **instp) {
filter_instance_t *inst = NULL;
@ -344,7 +344,7 @@ plugin_register(const char *parameters, const void *cfg, const char *cfg_file,
if (parameters != NULL) {
CHECK(parse_parameters(inst, parameters, cfg, cfg_file,
cfg_line, mctx, actx));
cfg_line, mctx, aclctx));
}
isc_ht_init(&inst->ht, mctx, 1, ISC_HT_CASE_SENSITIVE);
@ -367,7 +367,7 @@ cleanup:
isc_result_t
plugin_check(const char *parameters, const void *cfg, const char *cfg_file,
unsigned long cfg_line, isc_mem_t *mctx, void *actx) {
unsigned long cfg_line, isc_mem_t *mctx, void *aclctx) {
isc_result_t result = ISC_R_SUCCESS;
cfg_parser_t *parser = NULL;
cfg_obj_t *param_obj = NULL;
@ -380,7 +380,7 @@ plugin_check(const char *parameters, const void *cfg, const char *cfg_file,
CHECK(cfg_parse_buffer(parser, &b, cfg_file, cfg_line,
&cfg_type_parameters, 0, &param_obj));
CHECK(check_syntax(param_obj, cfg, mctx, actx));
CHECK(check_syntax(param_obj, cfg, mctx, aclctx));
cleanup:
if (param_obj != NULL) {

View file

@ -231,7 +231,7 @@ parse_filter_aaaa_on(const cfg_obj_t *param_obj, const char *param_name,
}
static isc_result_t
check_syntax(cfg_obj_t *fmap, const void *cfg, isc_mem_t *mctx, void *actx) {
check_syntax(cfg_obj_t *fmap, const void *cfg, isc_mem_t *mctx, void *aclctx) {
isc_result_t result = ISC_R_SUCCESS;
const cfg_obj_t *aclobj = NULL;
dns_acl_t *acl = NULL;
@ -243,7 +243,7 @@ check_syntax(cfg_obj_t *fmap, const void *cfg, isc_mem_t *mctx, void *actx) {
}
CHECK(cfg_acl_fromconfig(aclobj, (const cfg_obj_t *)cfg,
(cfg_aclconfctx_t *)actx, mctx, 0, &acl));
(cfg_aclconfctx_t *)aclctx, mctx, 0, &acl));
CHECK(parse_filter_aaaa_on(fmap, "filter-aaaa-on-v4", &f4));
CHECK(parse_filter_aaaa_on(fmap, "filter-aaaa-on-v6", &f6));
@ -273,7 +273,7 @@ cleanup:
static isc_result_t
parse_parameters(filter_instance_t *inst, const char *parameters,
const void *cfg, const char *cfg_file, unsigned long cfg_line,
isc_mem_t *mctx, void *actx) {
isc_mem_t *mctx, void *aclctx) {
isc_result_t result = ISC_R_SUCCESS;
cfg_parser_t *parser = NULL;
cfg_obj_t *param_obj = NULL;
@ -287,7 +287,7 @@ parse_parameters(filter_instance_t *inst, const char *parameters,
CHECK(cfg_parse_buffer(parser, &b, cfg_file, cfg_line,
&cfg_type_parameters, 0, &param_obj));
CHECK(check_syntax(param_obj, cfg, mctx, actx));
CHECK(check_syntax(param_obj, cfg, mctx, aclctx));
CHECK(parse_filter_aaaa_on(param_obj, "filter-aaaa-on-v4",
&inst->v4_aaaa));
@ -297,7 +297,7 @@ parse_parameters(filter_instance_t *inst, const char *parameters,
result = cfg_map_get(param_obj, "filter-aaaa", &obj);
if (result == ISC_R_SUCCESS) {
CHECK(cfg_acl_fromconfig(obj, (const cfg_obj_t *)cfg,
(cfg_aclconfctx_t *)actx, mctx, 0,
(cfg_aclconfctx_t *)aclctx, mctx, 0,
&inst->aaaa_acl));
} else {
CHECK(dns_acl_any(mctx, &inst->aaaa_acl));
@ -328,7 +328,7 @@ cleanup:
*/
isc_result_t
plugin_register(const char *parameters, const void *cfg, const char *cfg_file,
unsigned long cfg_line, isc_mem_t *mctx, void *actx,
unsigned long cfg_line, isc_mem_t *mctx, void *aclctx,
ns_hooktable_t *hooktable, ns_hooksource_t source,
void **instp) {
filter_instance_t *inst = NULL;
@ -348,7 +348,7 @@ plugin_register(const char *parameters, const void *cfg, const char *cfg_file,
if (parameters != NULL) {
CHECK(parse_parameters(inst, parameters, cfg, cfg_file,
cfg_line, mctx, actx));
cfg_line, mctx, aclctx));
}
isc_ht_init(&inst->ht, mctx, 1, ISC_HT_CASE_SENSITIVE);
@ -371,7 +371,7 @@ cleanup:
isc_result_t
plugin_check(const char *parameters, const void *cfg, const char *cfg_file,
unsigned long cfg_line, isc_mem_t *mctx, void *actx) {
unsigned long cfg_line, isc_mem_t *mctx, void *aclctx) {
isc_result_t result = ISC_R_SUCCESS;
cfg_parser_t *parser = NULL;
cfg_obj_t *param_obj = NULL;
@ -384,7 +384,7 @@ plugin_check(const char *parameters, const void *cfg, const char *cfg_file,
CHECK(cfg_parse_buffer(parser, &b, cfg_file, cfg_line,
&cfg_type_parameters, 0, &param_obj));
CHECK(check_syntax(param_obj, cfg, mctx, actx));
CHECK(check_syntax(param_obj, cfg, mctx, aclctx));
cleanup:
if (param_obj != NULL) {

View file

@ -124,7 +124,7 @@ logmsg(const char *fmt, ...) {
*/
isc_result_t
plugin_register(const char *parameters, const void *cfg, const char *cfg_file,
unsigned long cfg_line, isc_mem_t *mctx, void *actx,
unsigned long cfg_line, isc_mem_t *mctx, void *aclctx,
ns_hooktable_t *hooktable, ns_hooksource_t source,
void **instp) {
async_instance_t *inst = NULL;
@ -132,7 +132,7 @@ plugin_register(const char *parameters, const void *cfg, const char *cfg_file,
UNUSED(source);
UNUSED(parameters);
UNUSED(cfg);
UNUSED(actx);
UNUSED(aclctx);
isc_log_write(NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_HOOKS, ISC_LOG_INFO,
"registering 'test-async' module from %s:%lu", cfg_file,
@ -157,13 +157,13 @@ plugin_register(const char *parameters, const void *cfg, const char *cfg_file,
isc_result_t
plugin_check(const char *parameters, const void *cfg, const char *cfg_file,
unsigned long cfg_line, isc_mem_t *mctx, void *actx) {
unsigned long cfg_line, isc_mem_t *mctx, void *aclctx) {
UNUSED(parameters);
UNUSED(cfg);
UNUSED(cfg_file);
UNUSED(cfg_line);
UNUSED(mctx);
UNUSED(actx);
UNUSED(aclctx);
return ISC_R_SUCCESS;
}

View file

@ -112,7 +112,7 @@ syncplugin__parse_rcode(const cfg_obj_t *syncplugincfg, uint8_t *rcode) {
isc_result_t
plugin_register(const char *parameters, const void *cfg, const char *cfgfile,
unsigned long cfgline, isc_mem_t *mctx, void *actx,
unsigned long cfgline, isc_mem_t *mctx, void *aclctx,
ns_hooktable_t *hooktable, ns_hooksource_t source,
void **instp) {
isc_result_t result;
@ -125,7 +125,7 @@ plugin_register(const char *parameters, const void *cfg, const char *cfgfile,
char *sourcestr = NULL;
UNUSED(cfg);
UNUSED(actx);
UNUSED(aclctx);
UNUSED(source);
inst = isc_mem_get(mctx, sizeof(*inst));
@ -186,13 +186,13 @@ cleanup:
isc_result_t
plugin_check(const char *parameters, const void *cfg, const char *cfgfile,
unsigned long cfgline, isc_mem_t *mctx, void *actx) {
unsigned long cfgline, isc_mem_t *mctx, void *aclctx) {
UNUSED(parameters);
UNUSED(cfg);
UNUSED(cfgfile);
UNUSED(cfgline);
UNUSED(mctx);
UNUSED(actx);
UNUSED(aclctx);
return ISC_R_SUCCESS;
}

View file

@ -36,25 +36,25 @@ static const char *geoip_dbnames[] = {
#endif /* if defined(HAVE_GEOIP2) */
isc_result_t
cfg_aclconfctx_create(isc_mem_t *mctx, cfg_aclconfctx_t **ret) {
cfg_aclconfctx_t *actx;
cfg_aclconfctx_create(isc_mem_t *mctx, cfg_aclconfctx_t **aclctxp) {
cfg_aclconfctx_t *aclctx;
REQUIRE(mctx != NULL);
REQUIRE(ret != NULL && *ret == NULL);
REQUIRE(aclctxp != NULL && *aclctxp == NULL);
actx = isc_mem_get(mctx, sizeof(*actx));
aclctx = isc_mem_get(mctx, sizeof(*aclctx));
isc_refcount_init(&actx->references, 1);
isc_refcount_init(&aclctx->references, 1);
actx->mctx = NULL;
isc_mem_attach(mctx, &actx->mctx);
ISC_LIST_INIT(actx->named_acl_cache);
aclctx->mctx = NULL;
isc_mem_attach(mctx, &aclctx->mctx);
ISC_LIST_INIT(aclctx->named_acl_cache);
#if defined(HAVE_GEOIP2)
actx->geoip = NULL;
aclctx->geoip = NULL;
#endif /* if defined(HAVE_GEOIP2) */
*ret = actx;
*aclctxp = aclctx;
return ISC_R_SUCCESS;
}
@ -68,20 +68,20 @@ cfg_aclconfctx_attach(cfg_aclconfctx_t *src, cfg_aclconfctx_t **dest) {
}
void
cfg_aclconfctx_detach(cfg_aclconfctx_t **actxp) {
REQUIRE(actxp != NULL && *actxp != NULL);
cfg_aclconfctx_detach(cfg_aclconfctx_t **aclctxp) {
REQUIRE(aclctxp != NULL && *aclctxp != NULL);
cfg_aclconfctx_t *actx = *actxp;
*actxp = NULL;
cfg_aclconfctx_t *aclctx = *aclctxp;
*aclctxp = NULL;
if (isc_refcount_decrement(&actx->references) == 1) {
isc_refcount_destroy(&actx->references);
ISC_LIST_FOREACH(actx->named_acl_cache, dacl, nextincache) {
ISC_LIST_UNLINK(actx->named_acl_cache, dacl,
if (isc_refcount_decrement(&aclctx->references) == 1) {
isc_refcount_destroy(&aclctx->references);
ISC_LIST_FOREACH(aclctx->named_acl_cache, dacl, nextincache) {
ISC_LIST_UNLINK(aclctx->named_acl_cache, dacl,
nextincache);
dns_acl_detach(&dacl);
}
isc_mem_putanddetach(&actx->mctx, actx, sizeof(*actx));
isc_mem_putanddetach(&aclctx->mctx, aclctx, sizeof(*aclctx));
}
}

View file

@ -452,8 +452,9 @@ exists(const cfg_obj_t *obj, const char *name, int value, isc_symtab_t *symtab,
}
static isc_result_t
checkacl(const char *aclname, cfg_aclconfctx_t *actx, const cfg_obj_t *zconfig,
const cfg_obj_t *voptions, const cfg_obj_t *config, isc_mem_t *mctx) {
checkacl(const char *aclname, cfg_aclconfctx_t *aclctx,
const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
const cfg_obj_t *config, isc_mem_t *mctx) {
isc_result_t result = ISC_R_SUCCESS;
const cfg_obj_t *aclobj = NULL;
const cfg_obj_t *options;
@ -476,7 +477,7 @@ checkacl(const char *aclname, cfg_aclconfctx_t *actx, const cfg_obj_t *zconfig,
if (aclobj == NULL) {
return ISC_R_SUCCESS;
}
result = cfg_acl_fromconfig(aclobj, config, actx, mctx, 0, &acl);
result = cfg_acl_fromconfig(aclobj, config, aclctx, mctx, 0, &acl);
if (acl != NULL) {
dns_acl_detach(&acl);
}
@ -527,7 +528,7 @@ checkacl(const char *aclname, cfg_aclconfctx_t *actx, const cfg_obj_t *zconfig,
}
static isc_result_t
check_viewacls(cfg_aclconfctx_t *actx, const cfg_obj_t *voptions,
check_viewacls(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
const cfg_obj_t *config, isc_mem_t *mctx) {
isc_result_t result = ISC_R_SUCCESS, tresult;
int i = 0;
@ -541,7 +542,7 @@ check_viewacls(cfg_aclconfctx_t *actx, const cfg_obj_t *voptions,
};
while (acls[i] != NULL) {
tresult = checkacl(acls[i++], actx, NULL, voptions, config,
tresult = checkacl(acls[i++], aclctx, NULL, voptions, config,
mctx);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
@ -560,7 +561,7 @@ dns64_error(const cfg_obj_t *obj, isc_netaddr_t *netaddr,
}
static isc_result_t
check_dns64(cfg_aclconfctx_t *actx, const cfg_obj_t *voptions,
check_dns64(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
const cfg_obj_t *config, isc_mem_t *mctx) {
isc_result_t result = ISC_R_SUCCESS;
const cfg_obj_t *dns64 = NULL;
@ -621,8 +622,8 @@ check_dns64(cfg_aclconfctx_t *actx, const cfg_obj_t *voptions,
dns_acl_t *acl = NULL;
isc_result_t tresult;
tresult = cfg_acl_fromconfig(obj, config, actx,
mctx, 0, &acl);
tresult = cfg_acl_fromconfig(
obj, config, aclctx, mctx, 0, &acl);
if (acl != NULL) {
dns_acl_detach(&acl);
}
@ -684,7 +685,7 @@ check_dns64(cfg_aclconfctx_t *actx, const cfg_obj_t *voptions,
} while (0)
static isc_result_t
check_ratelimit(cfg_aclconfctx_t *actx, const cfg_obj_t *voptions,
check_ratelimit(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
const cfg_obj_t *config, isc_mem_t *mctx) {
isc_result_t result = ISC_R_SUCCESS;
isc_result_t mresult;
@ -787,7 +788,8 @@ check_ratelimit(cfg_aclconfctx_t *actx, const cfg_obj_t *voptions,
dns_acl_t *acl = NULL;
isc_result_t tresult;
tresult = cfg_acl_fromconfig(obj, config, actx, mctx, 0, &acl);
tresult = cfg_acl_fromconfig(obj, config, aclctx, mctx, 0,
&acl);
if (acl != NULL) {
dns_acl_detach(&acl);
}
@ -858,7 +860,7 @@ check_fetchlimit(const cfg_obj_t *voptions, const cfg_obj_t *config) {
* warning if they're inconsistent with the "recursion" option.
*/
static isc_result_t
check_recursionacls(cfg_aclconfctx_t *actx, const cfg_obj_t *voptions,
check_recursionacls(cfg_aclconfctx_t *aclctx, const cfg_obj_t *voptions,
const char *viewname, const cfg_obj_t *config,
isc_mem_t *mctx) {
const cfg_obj_t *options, *aclobj, *obj = NULL;
@ -910,7 +912,7 @@ check_recursionacls(cfg_aclconfctx_t *actx, const cfg_obj_t *voptions,
continue;
}
tresult = cfg_acl_fromconfig(aclobj, config, actx, mctx, 0,
tresult = cfg_acl_fromconfig(aclobj, config, aclctx, mctx, 0,
&acl);
if (tresult != ISC_R_SUCCESS) {
@ -1010,7 +1012,7 @@ find_maplist(const cfg_obj_t *config, const char *listname, const char *name) {
static isc_result_t
check_listener(const cfg_obj_t *listener, const cfg_obj_t *config,
cfg_aclconfctx_t *actx, isc_mem_t *mctx) {
cfg_aclconfctx_t *aclctx, isc_mem_t *mctx) {
isc_result_t tresult, result = ISC_R_SUCCESS;
const cfg_obj_t *ltup = NULL;
const cfg_obj_t *tlsobj = NULL, *httpobj = NULL;
@ -1112,7 +1114,7 @@ check_listener(const cfg_obj_t *listener, const cfg_obj_t *config,
}
tresult = cfg_acl_fromconfig(cfg_tuple_get(listener, "acl"), config,
actx, mctx, 0, &acl);
aclctx, mctx, 0, &acl);
if (result == ISC_R_SUCCESS) {
result = tresult;
}
@ -1126,12 +1128,12 @@ check_listener(const cfg_obj_t *listener, const cfg_obj_t *config,
static isc_result_t
check_listeners(const cfg_obj_t *list, const cfg_obj_t *config,
cfg_aclconfctx_t *actx, isc_mem_t *mctx) {
cfg_aclconfctx_t *aclctx, isc_mem_t *mctx) {
isc_result_t tresult, result = ISC_R_SUCCESS;
CFG_LIST_FOREACH(list, elt) {
const cfg_obj_t *obj = cfg_listelt_value(elt);
tresult = check_listener(obj, config, actx, mctx);
tresult = check_listener(obj, config, aclctx, mctx);
if (result == ISC_R_SUCCESS) {
result = tresult;
}
@ -1172,7 +1174,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
uint32_t lifetime = 3600;
dns_keystorelist_t kslist;
const char *ccalg = "siphash24";
cfg_aclconfctx_t *actx = NULL;
cfg_aclconfctx_t *aclctx = NULL;
static const char *sources[] = {
"query-source",
"query-source-v6",
@ -1946,14 +1948,15 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
}
}
cfg_aclconfctx_create(mctx, &actx);
cfg_aclconfctx_create(mctx, &aclctx);
obj = NULL;
(void)cfg_map_get(options, "sig0checks-quota-exempt", &obj);
if (obj != NULL) {
dns_acl_t *acl = NULL;
tresult = cfg_acl_fromconfig(obj, config, actx, mctx, 0, &acl);
tresult = cfg_acl_fromconfig(obj, config, aclctx, mctx, 0,
&acl);
if (acl != NULL) {
dns_acl_detach(&acl);
}
@ -1966,7 +1969,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
(void)cfg_map_get(options, "listen-on", &obj);
if (obj != NULL) {
INSIST(config != NULL);
tresult = check_listeners(obj, config, actx, mctx);
tresult = check_listeners(obj, config, aclctx, mctx);
if (result == ISC_R_SUCCESS) {
result = tresult;
}
@ -1976,7 +1979,7 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
(void)cfg_map_get(options, "listen-on-v6", &obj);
if (obj != NULL) {
INSIST(config != NULL);
tresult = check_listeners(obj, config, actx, mctx);
tresult = check_listeners(obj, config, aclctx, mctx);
if (result == ISC_R_SUCCESS) {
result = tresult;
}
@ -1996,8 +1999,8 @@ check_options(const cfg_obj_t *options, const cfg_obj_t *config,
}
}
if (actx != NULL) {
cfg_aclconfctx_detach(&actx);
if (aclctx != NULL) {
cfg_aclconfctx_detach(&aclctx);
}
return result;
@ -2768,7 +2771,7 @@ check_mirror_zone_notify(const cfg_obj_t *zoptions, const char *znamestr) {
*/
static bool
check_recursion(const cfg_obj_t *config, const cfg_obj_t *voptions,
const cfg_obj_t *goptions, cfg_aclconfctx_t *actx,
const cfg_obj_t *goptions, cfg_aclconfctx_t *aclctx,
isc_mem_t *mctx) {
dns_acl_t *acl = NULL;
const cfg_obj_t *obj;
@ -2804,7 +2807,7 @@ check_recursion(const cfg_obj_t *config, const cfg_obj_t *voptions,
result = cfg_map_get(goptions, "allow-recursion", &obj);
}
if (result == ISC_R_SUCCESS) {
result = cfg_acl_fromconfig(obj, config, actx, mctx, 0, &acl);
result = cfg_acl_fromconfig(obj, config, aclctx, mctx, 0, &acl);
if (result != ISC_R_SUCCESS) {
goto cleanup;
}
@ -3057,7 +3060,7 @@ check:
*/
struct check_one_plugin_data {
isc_mem_t *mctx;
cfg_aclconfctx_t *actx;
cfg_aclconfctx_t *aclctx;
isc_result_t *check_result;
};
@ -3070,13 +3073,13 @@ struct check_one_plugin_data {
*/
static isc_result_t
check_one_plugin(const cfg_obj_t *config, const cfg_obj_t *obj,
cfg_aclconfctx_t *actx, const char *plugin_path,
cfg_aclconfctx_t *aclctx, const char *plugin_path,
const char *parameters, void *callback_data) {
struct check_one_plugin_data *data = callback_data;
char full_path[PATH_MAX];
isc_result_t result = ISC_R_SUCCESS;
UNUSED(actx);
UNUSED(aclctx);
result = ns_plugin_expandpath(plugin_path, full_path,
sizeof(full_path));
@ -3090,7 +3093,7 @@ check_one_plugin(const cfg_obj_t *config, const cfg_obj_t *obj,
result = ns_plugin_check(full_path, parameters, config,
cfg_obj_file(obj), cfg_obj_line(obj),
data->mctx, data->actx);
data->mctx, data->aclctx);
if (result != ISC_R_SUCCESS) {
cfg_obj_log(obj, ISC_LOG_ERROR, "%s: plugin check failed: %s",
full_path, isc_result_totext(result));
@ -3102,15 +3105,15 @@ check_one_plugin(const cfg_obj_t *config, const cfg_obj_t *obj,
static isc_result_t
check_plugins(const cfg_obj_t *plugins, const cfg_obj_t *config,
cfg_aclconfctx_t *actx, isc_mem_t *mctx) {
cfg_aclconfctx_t *aclctx, isc_mem_t *mctx) {
isc_result_t result = ISC_R_SUCCESS;
struct check_one_plugin_data check_one_plugin_data = {
.mctx = mctx,
.actx = actx,
.aclctx = aclctx,
.check_result = &result,
};
(void)cfg_pluginlist_foreach(config, plugins, actx, check_one_plugin,
(void)cfg_pluginlist_foreach(config, plugins, aclctx, check_one_plugin,
&check_one_plugin_data);
return result;
@ -3152,7 +3155,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
isc_symtab_t *files, isc_symtab_t *keydirs,
isc_symtab_t *inview, const char *viewname,
dns_rdataclass_t defclass, unsigned int flags,
cfg_aclconfctx_t *actx, isc_mem_t *mctx) {
cfg_aclconfctx_t *aclctx, isc_mem_t *mctx) {
const char *znamestr = NULL;
const char *typestr = NULL;
const char *target = NULL;
@ -3524,7 +3527,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
* Check that ACLs expand correctly.
*/
for (i = 0; i < ARRAY_SIZE(acls); i++) {
tresult = checkacl(acls[i], actx, zconfig, voptions, config,
tresult = checkacl(acls[i], aclctx, zconfig, voptions, config,
mctx);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
@ -3672,7 +3675,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
* contradicts the purpose of the former.
*/
if (ztype == CFG_ZONE_MIRROR &&
!check_recursion(config, voptions, goptions, actx, mctx))
!check_recursion(config, voptions, goptions, aclctx, mctx))
{
cfg_obj_log(zoptions, ISC_LOG_ERROR,
"zone '%s': mirror zones cannot be used if "
@ -3720,8 +3723,8 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
ddns = true;
} else if (au != NULL) {
dns_acl_t *acl = NULL;
tresult = cfg_acl_fromconfig(au, config, actx, mctx, 0,
&acl);
tresult = cfg_acl_fromconfig(au, config, aclctx, mctx,
0, &acl);
if (tresult != ISC_R_SUCCESS) {
cfg_obj_log(au, ISC_LOG_ERROR,
"acl expansion failed: %s",
@ -4126,7 +4129,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
const cfg_obj_t *plugins = NULL;
(void)cfg_map_get(zoptions, "plugin", &plugins);
tresult = check_plugins(plugins, config, actx, mctx);
tresult = check_plugins(plugins, config, aclctx, mctx);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
@ -5432,7 +5435,7 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
isc_symtab_t *symtab = NULL;
isc_result_t result = ISC_R_SUCCESS;
isc_result_t tresult = ISC_R_SUCCESS;
cfg_aclconfctx_t *actx = NULL;
cfg_aclconfctx_t *aclctx = NULL;
const cfg_obj_t *obj = NULL;
const cfg_obj_t *options = NULL;
const cfg_obj_t *opts = NULL;
@ -5461,7 +5464,7 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
*/
isc_symtab_create(mctx, freekey, mctx, false, &symtab);
cfg_aclconfctx_create(mctx, &actx);
cfg_aclconfctx_create(mctx, &aclctx);
if (voptions != NULL) {
(void)cfg_map_get(voptions, "zone", &zones);
@ -5474,7 +5477,7 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
tresult = isccfg_check_zoneconf(
zone, voptions, config, symtab, files, keydirs, inview,
viewname, vclass, flags, actx, mctx);
viewname, vclass, flags, aclctx, mctx);
if (tresult != ISC_R_SUCCESS) {
result = ISC_R_FAILURE;
}
@ -5704,22 +5707,22 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
result = tresult;
}
tresult = check_viewacls(actx, voptions, config, mctx);
tresult = check_viewacls(aclctx, voptions, config, mctx);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
tresult = check_recursionacls(actx, voptions, viewname, config, mctx);
tresult = check_recursionacls(aclctx, voptions, viewname, config, mctx);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
tresult = check_dns64(actx, voptions, config, mctx);
tresult = check_dns64(aclctx, voptions, config, mctx);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
tresult = check_ratelimit(actx, voptions, config, mctx);
tresult = check_ratelimit(aclctx, voptions, config, mctx);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
@ -5738,7 +5741,7 @@ check_viewconf(const cfg_obj_t *config, const cfg_obj_t *voptions,
(void)cfg_map_get(config, "plugin", &plugins);
}
tresult = check_plugins(plugins, config, actx, mctx);
tresult = check_plugins(plugins, config, aclctx, mctx);
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
@ -5748,8 +5751,8 @@ cleanup:
if (symtab != NULL) {
isc_symtab_destroy(&symtab);
}
if (actx != NULL) {
cfg_aclconfctx_detach(&actx);
if (aclctx != NULL) {
cfg_aclconfctx_detach(&aclctx);
}
return result;
@ -5884,7 +5887,7 @@ check_controlskeys(const cfg_obj_t *control, const cfg_obj_t *keylist) {
static isc_result_t
check_controls(const cfg_obj_t *config, isc_mem_t *mctx) {
isc_result_t result = ISC_R_SUCCESS, tresult;
cfg_aclconfctx_t *actx = NULL;
cfg_aclconfctx_t *aclctx = NULL;
const cfg_obj_t *allow = NULL;
const cfg_obj_t *control = NULL;
const cfg_obj_t *controls = NULL;
@ -5904,7 +5907,7 @@ check_controls(const cfg_obj_t *config, isc_mem_t *mctx) {
(void)cfg_map_get(config, "key", &keylist);
cfg_aclconfctx_create(mctx, &actx);
cfg_aclconfctx_create(mctx, &aclctx);
isc_symtab_create(mctx, freekey, mctx, true, &symtab);
@ -5924,8 +5927,8 @@ check_controls(const cfg_obj_t *config, isc_mem_t *mctx) {
control = cfg_listelt_value(element2);
allow = cfg_tuple_get(control, "allow");
tresult = cfg_acl_fromconfig(allow, config, actx, mctx,
0, &acl);
tresult = cfg_acl_fromconfig(allow, config, aclctx,
mctx, 0, &acl);
if (acl != NULL) {
dns_acl_detach(&acl);
}
@ -5960,7 +5963,7 @@ check_controls(const cfg_obj_t *config, isc_mem_t *mctx) {
}
}
cfg_aclconfctx_detach(&actx);
cfg_aclconfctx_detach(&aclctx);
if (symtab != NULL) {
isc_symtab_destroy(&symtab);
}

View file

@ -34,13 +34,13 @@ typedef struct cfg_aclconfctx {
***/
isc_result_t
cfg_aclconfctx_create(isc_mem_t *mctx, cfg_aclconfctx_t **ret);
cfg_aclconfctx_create(isc_mem_t *mctx, cfg_aclconfctx_t **aclctxp);
/*
* Creates and initializes an ACL configuration context.
*/
void
cfg_aclconfctx_detach(cfg_aclconfctx_t **actxp);
cfg_aclconfctx_detach(cfg_aclconfctx_t **aclctxp);
/*
* Removes a reference to an ACL configuration context; when references
* reaches zero, clears the contents and deallocate the structure.

View file

@ -589,7 +589,7 @@ cfg_map_nextclause(const cfg_type_t *map, const void **clauses,
unsigned int *idx);
typedef isc_result_t(pluginlist_cb_t)(
const cfg_obj_t *config, const cfg_obj_t *obj, cfg_aclconfctx_t *actx,
const cfg_obj_t *config, const cfg_obj_t *obj, cfg_aclconfctx_t *aclctx,
const char *plugin_path, const char *parameters, void *callback_data);
/*%<
* Function prototype for the callback used with cfg_pluginlist_foreach().
@ -606,7 +606,7 @@ typedef isc_result_t(pluginlist_cb_t)(
isc_result_t
cfg_pluginlist_foreach(const cfg_obj_t *config, const cfg_obj_t *list,
cfg_aclconfctx_t *actx, pluginlist_cb_t *callback,
cfg_aclconfctx_t *aclctx, pluginlist_cb_t *callback,
void *callback_data);
/*%<
* For every "plugin" stanza present in 'list' (which in turn is a part of

View file

@ -79,7 +79,7 @@ isccfg_check_zoneconf(const cfg_obj_t *zconfig, const cfg_obj_t *voptions,
isc_symtab_t *files, isc_symtab_t *keydirs,
isc_symtab_t *inview, const char *viewname,
dns_rdataclass_t defclass, unsigned int flags,
cfg_aclconfctx_t *actx, isc_mem_t *mctx);
cfg_aclconfctx_t *aclctx, isc_mem_t *mctx);
/*%<
* Check the syntactic validity of a zone statement, either in a
* named.conf file or in an "rndc addzone" or "rndc modzone" command.

View file

@ -3945,7 +3945,7 @@ cleanup:
isc_result_t
cfg_pluginlist_foreach(const cfg_obj_t *config, const cfg_obj_t *list,
cfg_aclconfctx_t *actx, pluginlist_cb_t *callback,
cfg_aclconfctx_t *aclctx, pluginlist_cb_t *callback,
void *callback_data) {
isc_result_t result = ISC_R_SUCCESS;
@ -3976,7 +3976,7 @@ cfg_pluginlist_foreach(const cfg_obj_t *config, const cfg_obj_t *list,
parameters = cfg_obj_asstring(obj);
}
result = callback(config, obj, actx, library, parameters,
result = callback(config, obj, aclctx, library, parameters,
callback_data);
if (result != ISC_R_SUCCESS) {
break;

View file

@ -224,7 +224,7 @@ unload_plugin(ns_plugin_t **pluginp) {
isc_result_t
ns_plugin_register(const char *modpath, const char *parameters, const void *cfg,
const char *cfg_file, unsigned long cfg_line,
isc_mem_t *mctx, void *actx, ns_hook_data_t *hookdata) {
isc_mem_t *mctx, void *aclctx, ns_hook_data_t *hookdata) {
isc_result_t result;
ns_plugin_t *plugin = NULL;
@ -241,8 +241,8 @@ ns_plugin_register(const char *modpath, const char *parameters, const void *cfg,
INSIST(hookdata->source != NS_HOOKSOURCE_UNDEFINED);
CHECK(plugin->register_func(parameters, cfg, cfg_file, cfg_line, mctx,
actx, hookdata->hooktable, hookdata->source,
&plugin->inst));
aclctx, hookdata->hooktable,
hookdata->source, &plugin->inst));
ISC_LIST_APPEND(*hookdata->plugins, plugin, link);
@ -257,14 +257,14 @@ cleanup:
isc_result_t
ns_plugin_check(const char *modpath, const char *parameters, const void *cfg,
const char *cfg_file, unsigned long cfg_line, isc_mem_t *mctx,
void *actx) {
void *aclctx) {
isc_result_t result;
ns_plugin_t *plugin = NULL;
CHECK(load_plugin(mctx, modpath, &plugin));
result = plugin->check_func(parameters, cfg, cfg_file, cfg_line, mctx,
actx);
aclctx);
cleanup:
if (plugin != NULL) {

View file

@ -511,7 +511,7 @@ typedef struct ns_hook_data {
typedef isc_result_t
ns_plugin_register_t(const char *parameters, const void *cfg, const char *file,
unsigned long line, isc_mem_t *mctx, void *actx,
unsigned long line, isc_mem_t *mctx, void *aclctx,
ns_hooktable_t *hooktable, ns_hooksource_t source,
void **instp);
/*%<
@ -537,7 +537,7 @@ ns_plugin_destroy_t(void **instp);
typedef isc_result_t
ns_plugin_check_t(const char *parameters, const void *cfg, const char *file,
unsigned long line, isc_mem_t *mctx, void *actx);
unsigned long line, isc_mem_t *mctx, void *aclctx);
/*%<
* Check the validity of 'parameters'.
*/
@ -585,7 +585,7 @@ ns_plugin_expandpath(const char *src, char *dst, size_t dstsize);
isc_result_t
ns_plugin_register(const char *modpath, const char *parameters, const void *cfg,
const char *cfg_file, unsigned long cfg_line,
isc_mem_t *mctx, void *actx, ns_hook_data_t *hookdata);
isc_mem_t *mctx, void *aclctx, ns_hook_data_t *hookdata);
/*%<
* Load the plugin module specified from the file 'modpath', and
* register an instance using 'parameters'.
@ -593,7 +593,7 @@ ns_plugin_register(const char *modpath, const char *parameters, const void *cfg,
* 'cfg_file' and 'cfg_line' specify the location of the plugin
* declaration in the configuration file.
*
* 'cfg' and 'actx' are the configuration context and ACL configuration
* 'cfg' and 'aclctx' are the configuration context and ACL configuration
* context, respectively; they are passed as void * here in order to
* prevent this library from having a dependency on libisccfg).
*
@ -604,7 +604,7 @@ ns_plugin_register(const char *modpath, const char *parameters, const void *cfg,
isc_result_t
ns_plugin_check(const char *modpath, const char *parameters, const void *cfg,
const char *cfg_file, unsigned long cfg_line, isc_mem_t *mctx,
void *actx);
void *aclctx);
/*%<
* Open the plugin module at 'modpath' and check the validity of
* 'parameters', logging any errors or warnings found, then

View file

@ -118,7 +118,7 @@ struct ns_query {
bool authdbset;
bool isreferral;
isc_mutex_t fetchlock;
ns_hookasync_t *hookactx;
ns_hookasync_t *hookaclctx;
dns_rpz_st_t *rpz_st;
isc_bufferlist_t namebufs;
ISC_LIST(ns_dbversion_t) activeversions;

View file

@ -797,9 +797,9 @@ ns_query_cancel(ns_client_t *client) {
*fetchp = NULL;
}
}
if (client->query.hookactx != NULL) {
client->query.hookactx->cancel(client->query.hookactx);
client->query.hookactx = NULL;
if (client->query.hookaclctx != NULL) {
client->query.hookaclctx->cancel(client->query.hookaclctx);
client->query.hookaclctx = NULL;
}
UNLOCK(&client->query.fetchlock);
}
@ -6607,9 +6607,9 @@ query_hookresume(void *arg) {
REQUIRE(NS_CLIENT_VALID(client));
LOCK(&client->query.fetchlock);
if (client->query.hookactx != NULL) {
INSIST(rev->ctx == client->query.hookactx);
client->query.hookactx = NULL;
if (client->query.hookaclctx != NULL) {
INSIST(rev->ctx == client->query.hookaclctx);
client->query.hookaclctx = NULL;
canceled = false;
client->inner.now = isc_stdtime_now();
} else {
@ -6732,7 +6732,7 @@ ns_query_hookasync(query_ctx_t *qctx, ns_query_starthookasync_t runasync,
CTRACE(ISC_LOG_DEBUG(3), "ns_query_hookasync");
REQUIRE(NS_CLIENT_VALID(client));
REQUIRE(client->query.hookactx == NULL);
REQUIRE(client->query.hookaclctx == NULL);
REQUIRE(FETCH_RECTYPE_NORMAL(client) == NULL);
result = acquire_recursionquota(client);
@ -6743,7 +6743,7 @@ ns_query_hookasync(query_ctx_t *qctx, ns_query_starthookasync_t runasync,
qctx_save(qctx, &saved_qctx);
result = runasync(saved_qctx, client->manager->mctx, arg,
client->manager->loop, query_hookresume, client,
&client->query.hookactx);
&client->query.hookaclctx);
if (result != ISC_R_SUCCESS) {
goto cleanup_and_detach_from_quota;
}

View file

@ -621,7 +621,7 @@ typedef struct hookasync_data {
* this is actually called; otherwise tests would fail due to memory leak.
*/
static void
destroy_hookactx(ns_hookasync_t **ctxp) {
destroy_hookaclctx(ns_hookasync_t **ctxp) {
ns_hookasync_t *ctx = *ctxp;
*ctxp = NULL;
@ -630,7 +630,7 @@ destroy_hookactx(ns_hookasync_t **ctxp) {
/* 'cancel' callback of hook recursion ctx. */
static void
cancel_hookactx(ns_hookasync_t *ctx) {
cancel_hookaclctx(ns_hookasync_t *ctx) {
/* Mark the hook data so the test can confirm this is called. */
((hookasync_data_t *)ctx->private)->canceled = true;
}
@ -662,8 +662,8 @@ test_hookasync(query_ctx_t *qctx, isc_mem_t *mctx, void *arg, isc_loop_t *loop,
asdata->rev = rev;
*ctx = (ns_hookasync_t){
.destroy = destroy_hookactx,
.cancel = cancel_hookactx,
.destroy = destroy_hookaclctx,
.cancel = cancel_hookaclctx,
.private = asdata,
};
isc_mem_attach(mctx, &ctx->mctx);
@ -931,7 +931,7 @@ run_hookasync_test(const ns__query_hookasync_test_params_t *test) {
asdata.rev->cb(asdata.rev);
/* Confirm necessary cleanup has been performed. */
INSIST(qctx->client->query.hookactx == NULL);
INSIST(qctx->client->query.hookaclctx == NULL);
INSIST(qctx->client->inner.state == NS_CLIENTSTATE_WORKING);
INSIST(ns_stats_get_counter(
qctx->client->manager->sctx->nsstats,
@ -947,7 +947,7 @@ run_hookasync_test(const ns__query_hookasync_test_params_t *test) {
INSIST(asdata.lasthookpoint == test->hookpoint2);
}
} else {
INSIST(qctx->client->query.hookactx == NULL);
INSIST(qctx->client->query.hookaclctx == NULL);
}
/*
@ -1246,7 +1246,7 @@ typedef struct hookasync_e2e_data {
/* Cancel callback. Just need to be defined, it doesn't have to do anything. */
static void
cancel_e2ehookactx(ns_hookasync_t *ctx) {
cancel_e2ehookaclctx(ns_hookasync_t *ctx) {
UNUSED(ctx);
}
@ -1277,8 +1277,8 @@ test_hookasync_e2e(query_ctx_t *qctx, isc_mem_t *mctx, void *arg,
asdata->rev = rev;
*ctx = (ns_hookasync_t){
.destroy = destroy_hookactx,
.cancel = cancel_e2ehookactx,
.destroy = destroy_hookaclctx,
.cancel = cancel_e2ehookaclctx,
.private = asdata,
};
isc_mem_attach(mctx, &ctx->mctx);