From: Pieter Lexis Date: Wed, 14 Oct 2020 09:28:44 +0000 (+0200) Subject: LUA rec: fix uncaught DNSName init exception X-Git-Tag: auth-4.4.0-alpha2~32^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=388d3a438de516ee59459872319e27d58c68564b;p=thirdparty%2Fpdns.git LUA rec: fix uncaught DNSName init exception --- diff --git a/pdns/lua-record.cc b/pdns/lua-record.cc index 9c7e5dcd86..dfb4430baa 100644 --- a/pdns/lua-record.cc +++ b/pdns/lua-record.cc @@ -917,15 +917,22 @@ static void setupLuaRecords() lua.writeFunction("include", [&lua](string record) { + DNSName rec; try { - vector drs = lookup(DNSName(record) + s_lua_record_ctx->zone, QType::LUA, s_lua_record_ctx->zoneid); + rec = DNSName(record) + s_lua_record_ctx->zone; + } catch (const std::exception &e){ + g_log< drs = lookup(rec, QType::LUA, s_lua_record_ctx->zoneid); for(const auto& dr : drs) { auto lr = getRR(dr.dr); lua.executeCode(lr->getCode()); } } catch(std::exception& e) { - g_log<zone)<<": "<