From 300605ecde3a9ae4cbba85c1e1f19c9a18895b60 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 22 Jan 2025 19:28:43 +0100 Subject: [PATCH] TODO output 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 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/detect-lua.c b/src/detect-lua.c index e0bc3d5fb2bc..e065b7baaec0 100644 --- a/src/detect-lua.c +++ b/src/detect-lua.c @@ -400,9 +400,8 @@ static void *DetectLuaThreadInit(void *data) if (lua->allow_restricted_functions) { luaL_openlibs(t->luastate); - } else { - SCLuaSbLoadLibs(t->luastate); } + SCLuaSbLoadLibs(t->luastate); LuaRegisterExtensions(t->luastate); @@ -515,9 +514,8 @@ static int DetectLuaSetupPrime(DetectEngineCtx *de_ctx, DetectLuaData *ld, const return -1; if (ld->allow_restricted_functions) { luaL_openlibs(luastate); - } else { - SCLuaSbLoadLibs(luastate); } + SCLuaSbLoadLibs(luastate); /* hackish, needed to allow unittests to pass buffers as scripts instead of files */ #ifdef UNITTESTS