From: Victor Julien Date: Sun, 9 Mar 2025 19:19:53 +0000 (+0100) Subject: lua: remove script_api_ver X-Git-Tag: suricata-8.0.0-beta1~291 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fbfeea752af3781366bf6fdbd4cec0f12005556e;p=thirdparty%2Fsuricata.git lua: remove script_api_ver Not documented and never set to new values despite updates. Ticket: #7492. --- 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; }