From 7226a0b2e7584bd6f2bc3c9eea1f34c8881f6973 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 22 Jan 2025 19:28:43 +0100 Subject: [PATCH] detect/lua: register built-in libs also for open setup Register internal libs for the case where loading external modules is allowed. --- src/detect-lua.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/detect-lua.c b/src/detect-lua.c index 93306b2cc9..e5a8cb28c7 100644 --- a/src/detect-lua.c +++ b/src/detect-lua.c @@ -57,6 +57,7 @@ #include "util-var-name.h" #include "util-lua.h" +#include "util-lua-builtins.h" #include "util-lua-sandbox.h" static int DetectLuaMatch (DetectEngineThreadCtx *, @@ -474,6 +475,7 @@ static void *DetectLuaThreadInit(void *data) if (lua->allow_restricted_functions) { luaL_openlibs(t->luastate); + SCLuaRequirefBuiltIns(t->luastate); } else { SCLuaSbLoadLibs(t->luastate); } @@ -589,6 +591,7 @@ static int DetectLuaSetupPrime(DetectEngineCtx *de_ctx, DetectLuaData *ld, const return -1; if (ld->allow_restricted_functions) { luaL_openlibs(luastate); + SCLuaRequirefBuiltIns(luastate); } else { SCLuaSbLoadLibs(luastate); } -- 2.47.2