]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check that primary key names have not changed
authorMark Andrews <marka@isc.org>
Fri, 23 Sep 2022 06:52:44 +0000 (16:52 +1000)
committerMark Andrews <marka@isc.org>
Tue, 27 Sep 2022 11:54:02 +0000 (21:54 +1000)
When looking for changes in a catalog zone member zone we need to
also check if the TSIG key name associated with a primary server
has be added, removed or changed.

lib/dns/catz.c

index 203327624b6b761add84b6e545dd2fa87d6c1011..5c12874983bfee22b825caf91ee5c9dc39adeecc 100644 (file)
@@ -365,6 +365,20 @@ dns_catz_entry_cmp(const dns_catz_entry_t *ea, const dns_catz_entry_t *eb) {
                return (false);
        }
 
+       for (size_t i = 0; i < eb->opts.masters.count; i++) {
+               if ((ea->opts.masters.keys[i] == NULL) !=
+                   (eb->opts.masters.keys[i] == NULL)) {
+                       return (false);
+               }
+               if (ea->opts.masters.keys[i] == NULL) {
+                       continue;
+               }
+               if (!dns_name_equal(ea->opts.masters.keys[i],
+                                   eb->opts.masters.keys[i])) {
+                       return (false);
+               }
+       }
+
        /* If one is NULL and the other isn't, the entries don't match */
        if ((ea->opts.allow_query == NULL) != (eb->opts.allow_query == NULL)) {
                return (false);
@@ -393,7 +407,7 @@ dns_catz_entry_cmp(const dns_catz_entry_t *ea, const dns_catz_entry_t *eb) {
                }
        }
 
-       /* xxxwpk TODO compare dscps/keys! */
+       /* xxxwpk TODO compare dscps! */
        return (true);
 }