]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4563. [bug] Modified zones would occasionally fail to reload.
authorMark Andrews <marka@isc.org>
Thu, 2 Feb 2017 06:11:15 +0000 (17:11 +1100)
committerMark Andrews <marka@isc.org>
Thu, 2 Feb 2017 06:14:09 +0000 (17:14 +1100)
                        [RT #39424]

(cherry picked from commit dfe3068ef390b5bbc706530afff33d5722531f68)

CHANGES
lib/dns/zone.c

diff --git a/CHANGES b/CHANGES
index 7611fdb11a6cfa3781ecbececf4cb10fdf2458c5..2d3bb9cad018ac9d17295fb3e263d08c87c1662b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+4563.  [bug]           Modified zones would occasionally fail to reload.
+                       [RT #39424]
+
 4561.  [port]          Silence a warning in strict C99 compilers. [RT #44414]
 
 4560.  [bug]           mdig: add -m option to enable memory debugging rather
index 9d4191616b7e68b143b2fb7e1da77e6498d5c2ff..29f34e29c9c500d6137930d61ca675b5c3b0fb53 100644 (file)
@@ -1828,7 +1828,6 @@ zone_touched(dns_zone_t *zone) {
                        return (ISC_TRUE);
        }
 
-
        return (ISC_FALSE);
 }
 
@@ -1908,6 +1907,8 @@ zone_load(dns_zone_t *zone, unsigned int flags, isc_boolean_t locked) {
         * been loaded yet, zone->loadtime will be the epoch.
         */
        if (zone->masterfile != NULL) {
+               isc_time_t filetime;
+
                /*
                 * The file is already loaded.  If we are just doing a
                 * "rndc reconfig", we are done.
@@ -1927,6 +1928,16 @@ zone_load(dns_zone_t *zone, unsigned int flags, isc_boolean_t locked) {
                        result = DNS_R_UPTODATE;
                        goto cleanup;
                }
+
+
+               /*
+                * If the file modification time is in the past
+                * set loadtime to that value.
+                */
+               result = isc_file_getmodtime(zone->masterfile, &filetime);
+               if (result == ISC_R_SUCCESS &&
+                   isc_time_compare(&loadtime, &filetime) > 0)
+                       loadtime = filetime;
        }
 
        /*