* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: check.c,v 1.44.18.19 2005/08/23 02:31:36 marka Exp $ */
+/* $Id: check.c,v 1.44.18.20 2005/09/12 02:04:07 marka Exp $ */
/*! \file */
}
static isc_result_t
-checkacl(const char *aclname, cfg_obj_t *zconfig, cfg_obj_t *voptions,
- cfg_obj_t *config, isc_log_t *logctx, isc_mem_t *mctx)
+checkacl(const char *aclname, cfg_aclconfctx_t *actx, cfg_obj_t *zconfig,
+ cfg_obj_t *voptions, cfg_obj_t *config, isc_log_t *logctx,
+ isc_mem_t *mctx)
{
isc_result_t result;
cfg_obj_t *aclobj = NULL;
cfg_obj_t *options;
dns_acl_t *acl = NULL;
- cfg_aclconfctx_t actx;
if (zconfig != NULL) {
options = cfg_tuple_get(zconfig, "options");
}
if (aclobj == NULL)
return (ISC_R_SUCCESS);
- cfg_aclconfctx_init(&actx);
- result = cfg_acl_fromconfig(aclobj, config, logctx, &actx, mctx, &acl);
+ result = cfg_acl_fromconfig(aclobj, config, logctx, actx, mctx, &acl);
if (acl != NULL)
dns_acl_detach(&acl);
return (result);
}
static isc_result_t
-check_viewacls(cfg_obj_t *voptions, cfg_obj_t *config,
+check_viewacls(cfg_aclconfctx_t *actx, cfg_obj_t *voptions, cfg_obj_t *config,
isc_log_t *logctx, isc_mem_t *mctx)
{
isc_result_t result = ISC_R_SUCCESS, tresult;
"match-destinations", "sortlist", NULL };
while (acls[i] != NULL) {
- tresult = checkacl(acls[i++], NULL, voptions, config,
+ tresult = checkacl(acls[i++], actx, NULL, voptions, config,
logctx, mctx);
if (tresult != ISC_R_SUCCESS)
result = tresult;
static isc_result_t
check_zoneconf(cfg_obj_t *zconfig, cfg_obj_t *voptions, cfg_obj_t *config,
isc_symtab_t *symtab, dns_rdataclass_t defclass,
- isc_log_t *logctx, isc_mem_t *mctx)
+ cfg_aclconfctx_t *actx, isc_log_t *logctx, isc_mem_t *mctx)
{
const char *zname;
const char *typestr;
if ((options[i].allowed & ztype) != 0 &&
(options[i].allowed & CHECKACL) != 0) {
- tresult = checkacl(options[i].name, zconfig,
+ tresult = checkacl(options[i].name, actx, zconfig,
voptions, config, logctx, mctx);
if (tresult != ISC_R_SUCCESS)
result = tresult;
isc_symtab_t *symtab = NULL;
isc_result_t result = ISC_R_SUCCESS;
isc_result_t tresult = ISC_R_SUCCESS;
+ cfg_aclconfctx_t actx;
/*
* Check that all zone statements are syntactically correct and
if (tresult != ISC_R_SUCCESS)
return (ISC_R_NOMEMORY);
+ cfg_aclconfctx_init(&actx);
+
if (voptions != NULL)
(void)cfg_map_get(voptions, "zone", &zones);
else
cfg_obj_t *zone = cfg_listelt_value(element);
tresult = check_zoneconf(zone, voptions, config, symtab,
- vclass, logctx, mctx);
+ vclass, &actx, logctx, mctx);
if (tresult != ISC_R_SUCCESS)
result = ISC_R_FAILURE;
}
if (tresult != ISC_R_SUCCESS)
result = tresult;
- tresult = check_viewacls(voptions, config, logctx, mctx);
+ tresult = check_viewacls(&actx, voptions, config, logctx, mctx);
if (tresult != ISC_R_SUCCESS)
result = tresult;
+ cfg_aclconfctx_destroy(&actx);
+
return (result);
}
(void)cfg_map_get(config, "key", &keylist);
+ cfg_aclconfctx_init(&actx);
+
/*
* INET: Check allow clause.
* UNIX: Check "perm" for sanity, check path length.
element2 = cfg_list_next(element2)) {
control = cfg_listelt_value(element2);
allow = cfg_tuple_get(control, "allow");
- cfg_aclconfctx_init(&actx);
tresult = cfg_acl_fromconfig(allow, config, logctx,
- &actx, mctx, &acl);
+ &actx, mctx, &acl);
if (acl != NULL)
dns_acl_detach(&acl);
if (tresult != ISC_R_SUCCESS)
result = tresult;
}
}
+ cfg_aclconfctx_destroy(&actx);
return (result);
}