]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
lua: remove script_api_ver 12747/head
authorVictor Julien <vjulien@oisf.net>
Sun, 9 Mar 2025 19:19:53 +0000 (20:19 +0100)
committerVictor Julien <victor@inliniac.net>
Sun, 9 Mar 2025 20:52:44 +0000 (21:52 +0100)
Not documented and never set to new values despite updates.

Ticket: #7492.

src/detect-lua.c
src/output-lua.c

index e5a8cb28c78d0487e63928d64374ab77fc7b597d..f5ee77bb58e3d3df41fe300eb87d82e2440d48c6 100644 (file)
@@ -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;
     }
index f2461eb243213ba8b1aad9661556b406bc554ac7..7f1944b32223e7dfedb34d271653db2a5d2908d1 100644 (file)
@@ -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;
     }