From: Remi Gacogne Date: Tue, 28 Sep 2021 09:12:23 +0000 (+0200) Subject: rec: Use the correct RPZ policy name when loading via XFR X-Git-Tag: auth-4.6.0-alpha1~20^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F10768%2Fhead;p=thirdparty%2Fpdns.git rec: Use the correct RPZ policy name when loading via XFR 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 --- diff --git a/pdns/rpzloader.cc b/pdns/rpzloader.cc index df5de4b4e1..25b13701f3 100644 --- a/pdns/rpzloader.cc +++ b/pdns/rpzloader.cc @@ -383,7 +383,7 @@ void RPZIXFRTracker(const std::vector& 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));