]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth LUA shared exec: reset exec limit for every invocation 16119/head
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Sat, 13 Sep 2025 20:37:42 +0000 (22:37 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Sat, 13 Sep 2025 20:37:45 +0000 (22:37 +0200)
fixes #16118

pdns/lua-record.cc
regression-tests.auth-py/test_LuaRecords.py

index d649beaba17681f19db18a4f3b2446ce3e131dd9..cc8c235ec2de9347d2ca0720fd4844adc1842f15 100644 (file)
@@ -1635,10 +1635,6 @@ static void setupLuaRecords(LuaContext& lua)
       lua_report(event, line);
     });
 
-  if (g_luaRecordExecLimit > 0) {
-    lua.executeCode(boost::str(boost::format("debug.sethook(report, '', %d)") % g_luaRecordExecLimit));
-  }
-
   lua.writeFunction("latlon", []() -> string {
       return lua_latlon();
     });
@@ -1800,6 +1796,10 @@ std::vector<shared_ptr<DNSRecordContent>> luaSynth(const std::string& code, cons
   }
   lua.writeVariable("bestwho", s_lua_record_ctx->bestwho);
 
+  if (g_luaRecordExecLimit > 0) {
+    lua.executeCode(boost::str(boost::format("debug.sethook(report, '', %d)") % g_luaRecordExecLimit));
+  }
+
   try {
     string actual;
     if(!code.empty() && code[0]!=';')
index 6ea2ef1622842fd1bf2416269c8961be9f2f9837..b79b7c6a9d8fc7c5a47462dfb375535c19c45fe8 100644 (file)
@@ -1250,7 +1250,6 @@ any-to-tcp=no
 enable-lua-records=shared
 lua-records-insert-whitespace=yes
 lua-health-checks-interval=1
-lua-records-exec-limit=1500
 """
 
     def testCounter(self):