]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Pass an afg_aclconfctx_t structure to cfg_acl_fromconfig
authorMark Andrews <marka@isc.org>
Mon, 25 Jan 2021 05:14:02 +0000 (16:14 +1100)
committerMark Andrews <marka@isc.org>
Thu, 28 Jan 2021 01:54:59 +0000 (01:54 +0000)
in named_zone_inlinesigning.  A NULL pointer does not work.

bin/named/include/named/zoneconf.h
bin/named/server.c
bin/named/zoneconf.c

index 962d5a229af300a43c28bbacc5a07c33120da0a7..fadb3e1f38d443ef318d9c68f40d8c08a2e39425 100644 (file)
@@ -44,7 +44,8 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
 
 bool
 named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig,
-                   const cfg_obj_t *vconfig, const cfg_obj_t *config);
+                   const cfg_obj_t *vconfig, const cfg_obj_t *config,
+                   cfg_aclconfctx_t *actx);
 /*%<
  * If 'zone' can be safely reconfigured according to the configuration
  * data in 'zconfig', return true.  If the configuration data is so
@@ -54,7 +55,8 @@ named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig,
 
 bool
 named_zone_inlinesigning(dns_zone_t *zone, const cfg_obj_t *zconfig,
-                        const cfg_obj_t *vconfig, const cfg_obj_t *config);
+                        const cfg_obj_t *vconfig, const cfg_obj_t *config,
+                        cfg_aclconfctx_t *actx);
 /*%<
  * Determine if zone uses inline-signing. This is true if inline-signing
  * is set to yes, or if there is a dnssec-policy on a non-dynamic zone.
index 93f5ab839b176b033c5028a5f95c3d94a1d2f13d..2354a55ca2c8ee52e24af074e82cd175ed99197f 100644 (file)
@@ -6578,7 +6578,8 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
        }
 
        if (zone != NULL &&
-           !named_zone_reusable(zone, zconfig, vconfig, config)) {
+           !named_zone_reusable(zone, zconfig, vconfig, config, aclconf))
+       {
                dns_zone_detach(&zone);
        }
 
@@ -6658,8 +6659,8 @@ configure_zone(const cfg_obj_t *config, const cfg_obj_t *zconfig,
                              strcasecmp(ztypestr, "slave") == 0));
 
        if (zone_maybe_inline) {
-               inline_signing = named_zone_inlinesigning(zone, zconfig,
-                                                         vconfig, config);
+               inline_signing = named_zone_inlinesigning(
+                       zone, zconfig, vconfig, config, aclconf);
        }
        if (inline_signing) {
                dns_zone_getraw(zone, &raw);
index 74a5c9c8cfe914213e95a99f30447ed3cdc9e818..9ad830b3164c623ed72a57bb00bb34934f2e7c7a 100644 (file)
@@ -176,7 +176,7 @@ configure_zone_acl(const cfg_obj_t *zconfig, const cfg_obj_t *vconfig,
 
 parse_acl:
        result = cfg_acl_fromconfig(aclobj, config, named_g_lctx, actx,
-                                   dns_zone_getmctx(zone), 0, &acl);
+                                   named_g_mctx, 0, &acl);
        if (result != ISC_R_SUCCESS) {
                return (result);
        }
@@ -2068,7 +2068,8 @@ named_zone_configure_writeable_dlz(dns_dlzdb_t *dlzdatabase, dns_zone_t *zone,
 
 bool
 named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig,
-                   const cfg_obj_t *vconfig, const cfg_obj_t *config) {
+                   const cfg_obj_t *vconfig, const cfg_obj_t *config,
+                   cfg_aclconfctx_t *actx) {
        const cfg_obj_t *zoptions = NULL;
        const cfg_obj_t *obj = NULL;
        const char *cfilename;
@@ -2103,7 +2104,7 @@ named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig,
        }
 
        inline_signing = named_zone_inlinesigning(zone, zconfig, vconfig,
-                                                 config);
+                                                 config, actx);
        if (!inline_signing && has_raw) {
                dns_zone_log(zone, ISC_LOG_DEBUG(1),
                             "not reusable: old zone was inline-signing");
@@ -2141,7 +2142,8 @@ named_zone_reusable(dns_zone_t *zone, const cfg_obj_t *zconfig,
 
 bool
 named_zone_inlinesigning(dns_zone_t *zone, const cfg_obj_t *zconfig,
-                        const cfg_obj_t *vconfig, const cfg_obj_t *config) {
+                        const cfg_obj_t *vconfig, const cfg_obj_t *config,
+                        cfg_aclconfctx_t *actx) {
        isc_result_t res;
        const cfg_obj_t *zoptions = NULL;
        const cfg_obj_t *voptions = NULL;
@@ -2181,7 +2183,6 @@ named_zone_inlinesigning(dns_zone_t *zone, const cfg_obj_t *zconfig,
                }
                if (res == ISC_R_SUCCESS) {
                        dns_acl_t *acl = NULL;
-                       cfg_aclconfctx_t *actx = NULL;
                        res = cfg_acl_fromconfig(
                                allowupdate, config, named_g_lctx, actx,
                                dns_zone_getmctx(zone), 0, &acl);