]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: log an error when invalid custom metric name is given
authorCharles-Henri Bruyand <charles-henri.bruyand@open-xchange.com>
Thu, 2 Jun 2022 13:45:42 +0000 (15:45 +0200)
committerCharles-Henri Bruyand <charles-henri.bruyand@open-xchange.com>
Thu, 2 Jun 2022 13:45:42 +0000 (15:45 +0200)
pdns/dnsdist-lua.cc

index 3215e633f4cfd24eb38f2a65b48380cbf44ab5b1..64c06ee9b1e2220e4394a7d775aedaf570c79ce1 100644 (file)
@@ -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") {