Skip to content

Commit 1520855

Browse files
committed
detect/lua: register built-in libs also for open setup
Register internal libs for the case where loading external modules is allowed.
1 parent 799b8f7 commit 1520855

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/detect-lua.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,8 @@ static void *DetectLuaThreadInit(void *data)
474474

475475
if (lua->allow_restricted_functions) {
476476
luaL_openlibs(t->luastate);
477-
} else {
478-
SCLuaSbLoadLibs(t->luastate);
479477
}
478+
SCLuaSbLoadLibs(t->luastate);
480479

481480
LuaRegisterExtensions(t->luastate);
482481

@@ -589,9 +588,8 @@ static int DetectLuaSetupPrime(DetectEngineCtx *de_ctx, DetectLuaData *ld, const
589588
return -1;
590589
if (ld->allow_restricted_functions) {
591590
luaL_openlibs(luastate);
592-
} else {
593-
SCLuaSbLoadLibs(luastate);
594591
}
592+
SCLuaSbLoadLibs(luastate);
595593

596594
/* hackish, needed to allow unittests to pass buffers as scripts instead of files */
597595
#ifdef UNITTESTS

0 commit comments

Comments
 (0)