]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1168. [bug] Empty also-notify clauses were not handled gracefully.
authorMark Andrews <marka@isc.org>
Sat, 29 Dec 2001 04:49:51 +0000 (04:49 +0000)
committerMark Andrews <marka@isc.org>
Sat, 29 Dec 2001 04:49:51 +0000 (04:49 +0000)
                        [RT #2309]

CHANGES
lib/bind9/check.c

diff --git a/CHANGES b/CHANGES
index 031d22a80e5997891d94d12878a26aba4d10d968..766ecfa37c0fcb6e8d220d26ce14d5633a575308 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+1168.  [bug]           Empty also-notify clauses were not handled gracefully.
+                       [RT #2309]
+
 1167.  [contrib]       nslint-2.1a3 (from author).
 
 1166.  [bug]           "Not Implemented" should be reported as NOTIMP,
index 1483f900c5d7f05a2ae4441de02b5294bf1df663..f92fb6b4bba284a27b4ba08328654f82230f8ad1 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: check.c,v 1.12 2001/12/17 22:56:58 marka Exp $ */
+/* $Id: check.c,v 1.13 2001/12/29 04:49:51 marka Exp $ */
 
 #include <config.h>
 
@@ -60,6 +60,7 @@ static isc_result_t
 check_options(cfg_obj_t *options, isc_log_t *logctx) {
        isc_result_t result = ISC_R_SUCCESS;
        unsigned int i;
+       cfg_obj_t *obj = NULL;
 
        static intervaltable intervals[] = {
        { "cleaning-interval", 60, 28 * 24 * 60 },      /* 28 days */
@@ -79,7 +80,7 @@ check_options(cfg_obj_t *options, isc_log_t *logctx) {
         */
        for (i = 0; i < sizeof(intervals) / sizeof(intervals[0]); i++) {
                isc_uint32_t val;
-               cfg_obj_t *obj = NULL;
+               obj = NULL;
                (void)cfg_map_get(options, intervals[i].name, &obj);
                if (obj == NULL)
                        continue;
@@ -97,6 +98,18 @@ check_options(cfg_obj_t *options, isc_log_t *logctx) {
                        result = ISC_R_RANGE;
                }
        }
+       obj = NULL;
+       (void)cfg_map_get(options, "also-notify", &obj);
+       if (obj != NULL) {
+               cfg_obj_t *addrlist = NULL;
+               addrlist = cfg_tuple_get(obj, "addresses");
+               if (cfg_list_first(addrlist) == NULL) {
+                       cfg_obj_log(options, logctx, ISC_LOG_ERROR,
+                                   "empty 'also-notify' entry");
+                       if (result == ISC_R_SUCCESS)
+                               result = ISC_R_FAILURE;
+               }
+       }
        return (result);
 }