]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Clear the caches *after* loading authzones. 11847/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 10 Aug 2022 11:30:24 +0000 (13:30 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 11 Aug 2022 07:12:01 +0000 (09:12 +0200)
(cherry picked from commit 799114529470923a5e633dadc47b59c4e2a7e220)

pdns/reczones.cc

index c0770bfdb785698816e0f3ca2660cad6fee55004..a9bd95e8cc3910310772a9e0808b2ff4531c3fa4 100644 (file)
@@ -362,15 +362,18 @@ string reloadZoneConfiguration()
       }
     }
 
-    for (const auto& i : oldAndNewDomains) {
-      wipeCaches(i, true, 0xffff);
-    }
-
     // these explicitly-named captures should not be necessary, as lambda
     // capture of tuple-like structured bindings is permitted, but some
     // compilers still don't allow it
     broadcastFunction([dm = newDomainMap] { return pleaseUseNewSDomainsMap(dm); });
     broadcastFunction([ns = newNotifySet] { return pleaseSupplantAllowNotifyFor(ns); });
+
+    // Wipe the caches *after* the new auth domain info has been set
+    // up, as a query during setting up might fill the caches
+    // again. Old code did the clear before, exposing a race.
+    for (const auto& i : oldAndNewDomains) {
+      wipeCaches(i, true, 0xffff);
+    }
     return "ok\n";
   }
   catch (std::exception& e) {