From fbfeea752af3781366bf6fdbd4cec0f12005556e Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sun, 9 Mar 2025 20:19:53 +0100 Subject: [PATCH] lua: remove script_api_ver Not documented and never set to new values despite updates. Ticket: #7492. --- src/detect-lua.c | 12 +----------- src/output-lua.c | 12 +----------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/detect-lua.c b/src/detect-lua.c index e5a8cb28c7..f5ee77bb58 100644 --- a/src/detect-lua.c +++ b/src/detect-lua.c @@ -627,17 +627,7 @@ static int DetectLuaSetupPrime(DetectEngineCtx *de_ctx, DetectLuaData *ld, const goto error; } - lua_newtable(luastate); /* stack at -1 */ - if (lua_gettop(luastate) == 0 || lua_type(luastate, 2) != LUA_TTABLE) { - SCLogError("no table setup"); - goto error; - } - - lua_pushliteral(luastate, "script_api_ver"); /* stack at -2 */ - lua_pushnumber (luastate, 1); /* stack at -3 */ - lua_settable(luastate, -3); - - if (lua_pcall(luastate, 1, 1, 0) != 0) { + if (lua_pcall(luastate, 0, 1, 0) != 0) { SCLogError("couldn't run script 'init' function: %s", lua_tostring(luastate, -1)); goto error; } diff --git a/src/output-lua.c b/src/output-lua.c index f2461eb243..7f1944b322 100644 --- a/src/output-lua.c +++ b/src/output-lua.c @@ -467,17 +467,7 @@ static int LuaScriptInit(const char *filename, LogLuaScriptOptions *options, Log goto error; } - lua_newtable(luastate); /* stack at -1 */ - if (lua_gettop(luastate) == 0 || lua_type(luastate, 2) != LUA_TTABLE) { - SCLogError("no table setup"); - goto error; - } - - lua_pushliteral(luastate, "script_api_ver"); - lua_pushnumber (luastate, 1); - lua_settable(luastate, -3); - - if (lua_pcall(luastate, 1, 1, 0) != 0) { + if (lua_pcall(luastate, 0, 1, 0) != 0) { SCLogError("couldn't run script 'init' function: %s", lua_tostring(luastate, -1)); goto error; } -- 2.47.2