]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: Use the correct RPZ policy name when loading via XFR 10768/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 28 Sep 2021 09:12:23 +0000 (11:12 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 28 Sep 2021 09:16:55 +0000 (11:16 +0200)
This commit fixes two issues:
- if the existing zone name is not empty we should use it, instead of
  the zone domain
- if the zone domain has to be used, it should not include a final dot

pdns/rpzloader.cc

index df5de4b4e153594bc1205b48b56e4eea73a56dac..25b13701f3e28494a8050718929793e5d8eaff9c 100644 (file)
@@ -383,7 +383,7 @@ void RPZIXFRTracker(const std::vector<ComboAddress>& primaries, const boost::opt
   // If oldZone failed to load its getRefresh() returns 0, protect against that
   uint32_t refresh = std::max(refreshFromConf ? refreshFromConf : oldZone->getRefresh(), 10U);
   DNSName zoneName = oldZone->getDomain();
-  std::string polName = oldZone->getName().empty() ? oldZone->getName() : zoneName.toString();
+  std::string polName = !oldZone->getName().empty() ? oldZone->getName() : zoneName.toStringNoDot();
 
   // Now that we know the name, set it in the logger
   logger = logger->withValues("zone", Logging::Loggable(zoneName));