From 3e86a970828dda814a140c9613311a8507c3c458 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 28 Sep 2021 11:12:23 +0200 Subject: [PATCH] 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 --- pdns/rpzloader.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); -- 2.47.2