From: Charles-Henri Bruyand Date: Thu, 2 Jun 2022 13:45:42 +0000 (+0200) Subject: dnsdist: log an error when invalid custom metric name is given X-Git-Tag: auth-4.8.0-alpha0~79^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3dda01dfdeec2fd733a87590553bee3c9461f183;p=thirdparty%2Fpdns.git dnsdist: log an error when invalid custom metric name is given --- 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") {