From: Victor Julien Date: Wed, 22 Jan 2025 18:28:43 +0000 (+0100) Subject: detect/lua: register built-in libs also for open setup X-Git-Tag: suricata-8.0.0-beta1~446 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7226a0b2e7584bd6f2bc3c9eea1f34c8881f6973;p=thirdparty%2Fsuricata.git detect/lua: register built-in libs also for open setup Register internal libs for the case where loading external modules is allowed. --- 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); }