]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fix automatic journal upgrade on windows
authorEvan Hunt <each@isc.org>
Fri, 5 Mar 2021 22:28:33 +0000 (14:28 -0800)
committerOndřej Surý <ondrej@isc.org>
Mon, 8 Mar 2021 08:43:00 +0000 (09:43 +0100)
- use a value less than 2^32 for DNS_ZONEFLG_FIXJOURNAL; a larger value
  could cause problems in some build environments. the zone flag
  DNS_ZONEFLG_DIFFONRELOAD, which was no longer in use, has now been
  deleted and its value reused for _FIXJOURNAL.

(cherry picked from commit 990dd9dbff5826af3549ca60df6f15b74a345d9a)

lib/dns/include/dns/journal.h
lib/dns/zone.c

index e115bbc226e5925fae126823fc3488a2de7130e5..be6d72ba43f6adcb42790a60bf18a8669d5a775a 100644 (file)
@@ -302,8 +302,24 @@ dns_journal_compact(isc_mem_t *mctx, char *filename, uint32_t serial,
                    uint32_t flags, uint32_t target_size);
 /*%<
  * Attempt to compact the journal if it is greater that 'target_size'.
- * Changes from 'serial' onwards will be preserved.  If the journal
- * exists and is non-empty 'serial' must exist in the journal.
+ * Changes from 'serial' onwards will be preserved. Changes prior than
+ * that may be dropped in order to get the journal below `target_size`.
+ *
+ * If 'flags' includes DNS_JOURNAL_COMPACTALL, the entire journal is copied.
+ * In this case, `serial` is ignored. This flag is used when upgrading or
+ * downgrading the format version of the journal. If 'flags' also includes
+ * DNS_JOURNAL_VERSION1, then the journal is copied out in the original
+ * format used prior to BIND 9.16.12; otherwise it is copied in the
+ * current format.
+ *
+ * If _COMPACTALL is not in use, and the journal file exists and is
+ * non-empty, then 'serial' must exist in the journal.
+ *
+ * Returns:
+ *\li  ISC_R_SUCCESS
+ *\li  ISC_R_RANGE     serial is outside the range existing in the journal
+ *
+ * Other errors may be returned from file operations.
  */
 
 bool
@@ -314,7 +330,7 @@ dns_journal_set_sourceserial(dns_journal_t *j, uint32_t sourceserial);
  * Get and set source serial.
  *
  * Returns:
- *      true if sourceserial has previously been set.
+ *      true if sourceserial has previously been set.
  */
 
 ISC_LANG_ENDDECLS
index 17f9bd353d153856a8ccbafdeef4268739786445..5d3e6d2fc7a097b619fe0a8d682f427250181355 100644 (file)
@@ -470,17 +470,18 @@ typedef enum {
                                                * up-to-date */
        DNS_ZONEFLG_NEEDNOTIFY = 0x00000400U,  /*%< need to send out notify
                                                * messages */
-       DNS_ZONEFLG_DIFFONRELOAD = 0x00000800U, /*%< generate a journal diff on
-                                                * reload */
-       DNS_ZONEFLG_NOMASTERS = 0x00001000U,    /*%< an attempt to refresh a
-                                                * zone with no primaries
-                                                * occurred */
-       DNS_ZONEFLG_LOADING = 0x00002000U,    /*%< load from disk in progress*/
-       DNS_ZONEFLG_HAVETIMERS = 0x00004000U, /*%< timer values have been set
-                                              * from SOA (if not set, we
-                                              * are still using
-                                              * default timer values) */
-       DNS_ZONEFLG_FORCEXFER = 0x00008000U,  /*%< Force a zone xfer */
+       DNS_ZONEFLG_FIXJOURNAL = 0x00000800U,  /*%< journal file had
+                                               * recoverable error,
+                                               * needs rewriting */
+       DNS_ZONEFLG_NOMASTERS = 0x00001000U,   /*%< an attempt to refresh a
+                                               * zone with no primaries
+                                               * occurred */
+       DNS_ZONEFLG_LOADING = 0x00002000U,     /*%< load from disk in progress*/
+       DNS_ZONEFLG_HAVETIMERS = 0x00004000U,  /*%< timer values have been set
+                                               * from SOA (if not set, we
+                                               * are still using
+                                               * default timer values) */
+       DNS_ZONEFLG_FORCEXFER = 0x00008000U,   /*%< Force a zone xfer */
        DNS_ZONEFLG_NOREFRESH = 0x00010000U,
        DNS_ZONEFLG_DIALNOTIFY = 0x00020000U,
        DNS_ZONEFLG_DIALREFRESH = 0x00040000U,
@@ -500,9 +501,11 @@ typedef enum {
                                                      * notify due to the zone
                                                      * just being loaded for
                                                      * the first time. */
-       DNS_ZONEFLG_FIXJOURNAL = 0x100000000U,       /*%< journal file had
-                                                     * recoverable error,
-                                                     * needs rewriting */
+       /*
+        * DO NOT add any new zone flags here until all platforms
+        * support 64-bit enum values. Currently they fail on
+        * Windows.
+        */
        DNS_ZONEFLG___MAX = UINT64_MAX, /* trick to make the ENUM 64-bit wide */
 } dns_zoneflg_t;