Skip to content

Commit

Permalink
TODO output detect/lua: register built-in libs also for open setup
Browse files Browse the repository at this point in the history
Register internal libs for the case where loading external modules is allowed.
  • Loading branch information
victorjulien committed Jan 22, 2025
1 parent ecf9b5f commit 300605e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/detect-lua.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 300605e

Please sign in to comment.