From: Remi Gacogne Date: Mon, 20 Apr 2026 10:33:18 +0000 (+0200) Subject: dnsdist: Fix the `StatNode::fullname` issue introduced in 2.0.4 X-Git-Tag: auth-5.1.0-beta1~26^2 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=bd21d60;p=thirdparty%2Fpdns.git dnsdist: Fix the `StatNode::fullname` issue introduced in 2.0.4 Signed-off-by: Remi Gacogne --- diff --git a/pdns/dnsdistdist/dnsdist-lua-inspection.cc b/pdns/dnsdistdist/dnsdist-lua-inspection.cc index 8c08dbb390..9a793ef30d 100644 --- a/pdns/dnsdistdist/dnsdist-lua-inspection.cc +++ b/pdns/dnsdistdist/dnsdist-lua-inspection.cc @@ -902,7 +902,13 @@ void setupLuaInspection(LuaContext& luaCtx) [](const StatNode& node) -> unsigned int { return node.size(); }); - luaCtx.registerMember(std::string("fullname"), [](const StatNode& node) -> std::string { return node.fullname.toString(); }); + luaCtx.registerMember(std::string("fullname"), [](const StatNode& node) -> std::string { + /* we are not using toLogString() because we want: + - an empty string for empty + - trailing dots otherwise + */ + return !node.fullname.empty() ? node.fullname.toString() : ""; + }); luaCtx.registerMember("labelsCount", &StatNode::labelsCount); luaCtx.registerMember("servfails", &StatNode::Stat::servfails); luaCtx.registerMember("nxdomains", &StatNode::Stat::nxdomains);