From 3dda01dfdeec2fd733a87590553bee3c9461f183 Mon Sep 17 00:00:00 2001 From: Charles-Henri Bruyand Date: Thu, 2 Jun 2022 15:45:42 +0200 Subject: [PATCH] dnsdist: log an error when invalid custom metric name is given --- pdns/dnsdist-lua.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index 3215e633f4..64c06ee9b1 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -2869,6 +2869,8 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) return false; } if (!std::regex_match(name, std::regex("^[a-z0-9-]+$"))) { + g_outputBuffer = "Unable to declare metric '" + name + "': invalid name\n"; + errlog("Unable to declare metric '%s': invalid name", name); return false; } if (type == "counter") { -- 2.47.2