From: Russ Combs Date: Wed, 22 Jul 2015 23:12:43 +0000 (-0400) Subject: build 162; manage lua stack in shell; update change log X-Git-Tag: 3.0.0-233~899 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d934ca8b335ae3e829402f4acf837e365cd76ea3;p=thirdparty%2Fsnort3.git build 162; manage lua stack in shell; update change log --- diff --git a/ChangeLog b/ChangeLog index fd0dd8de0..e48a8a80c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +15/07/22 - build 162 + +-- enable build dependency tracking +-- cleanup automake and cmake foo +-- updated bug list +-- added Lua stack manager and updated code that manipulated a persistent lua_State + thanks to Sancho Panza (sancho@posteo.de) for reporting the issue +-- piglet updates and fixes +-- dev guide - convert snort includes into links +-- fixup includes + 15/07/15 - build 161 -- added piglet plugin test harness diff --git a/src/main/build.h b/src/main/build.h index 91e68cf27..7945649b7 100644 --- a/src/main/build.h +++ b/src/main/build.h @@ -10,7 +10,7 @@ // // //-----------------------------------------------// -#define BUILD "161" +#define BUILD "162" #endif diff --git a/src/main/shell.cc b/src/main/shell.cc index 1992c9be5..997be09ea 100644 --- a/src/main/shell.cc +++ b/src/main/shell.cc @@ -26,6 +26,7 @@ #include #include "framework/module.h" +#include "helpers/lua.h" #include "managers/module_manager.h" #include "parser/parser.h" #include "log/messages.h" @@ -68,6 +69,8 @@ static int get_line_number(lua_State* L) static void load_config(lua_State* L, const char* file) { + Lua::ManageStack ms(L); + if ( luaL_loadfile(L, file) ) { FatalError("can't load %s: %s\n", file, lua_tostring(L, -1)); @@ -75,14 +78,13 @@ static void load_config(lua_State* L, const char* file) } if ( lua_pcall(L, 0, 0, 0) ) - { FatalError("can't init %s: %s\n", file, lua_tostring(L, -1)); - return; - } } static void load_overrides(lua_State* L, string& s) { + Lua::ManageStack ms(L); + if ( luaL_loadstring(L, s.c_str()) ) { const char* err = lua_tostring(L, -1); @@ -93,14 +95,13 @@ static void load_overrides(lua_State* L, string& s) } if ( lua_pcall(L, 0, 0, 0) ) - { FatalError("can't init overrides: %s\n", lua_tostring(L, -1)); - return; - } } static void run_config(lua_State* L, const char* t) { + Lua::ManageStack ms(L); + lua_getglobal(L, "snort_config"); lua_getglobal(L, t); @@ -191,6 +192,7 @@ void Shell::install(const char* name, const luaL_Reg* reg) void Shell::execute(const char* cmd, string& rsp) { int err = 0; + Lua::ManageStack ms(lua); try {