]> 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 02:43:47 +0000 (13:43 +1100)
in named_zone_inlinesigning.  A NULL pointer does not work.

(cherry picked from commit 2b3fcd7156808b9423cf91655dae45c08c180638)

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 1d7d3e47ce1ecc66b2aed4b369da40cb98b6140d..ef0959cf520385ba38319ceab403e6e633215148 100644 (file)
@@ -6371,7 +6371,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);
        }
 
@@ -6451,8 +6452,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 32b6aedb7f159b156520d1973e1782a4f710b969..65e7c47459942f37efc2188afadd98805495e7e5 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);
        }
@@ -2047,7 +2047,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;
@@ -2082,7 +2083,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");
@@ -2120,7 +2121,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;
@@ -2160,7 +2162,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);