Closed AnoopAlias closed 6 years ago
Just tested this with the latest v3/master source and looks like its finding lua correctly now but i get compile error Host : CentOS7 x86_64
/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_GEOIP -I/usr/include/ -DWITH_YAJL -DPCRE_HAVE_JIT -DWITH_SSDEEP -I/usr/include -DWITH_LUA -I/usr/include -I/usr/include/libxml2 -DWITH_LIBXML2 -g -O2 -MT engine/libmodsecurity_la-lua.lo -MD -MP -MF engine/.deps/libmodsecurity_la-lua.Tpo -c -o engine/libmodsecurity_la-lua.lo `test -f 'engine/lua.cc' || echo './'`engine/lua.cc
libtool: compile: g++ -DHAVE_CONFIG_H -I. -std=c++11 -I.. -g -I../others -fPIC -O3 -I../headers -DWITH_GEOIP -I/usr/include/ -DWITH_YAJL -DPCRE_HAVE_JIT -DWITH_SSDEEP -I/usr/include -DWITH_LUA -I/usr/include -I/usr/include/libxml2 -DWITH_LIBXML2 -g -O2 -MT engine/libmodsecurity_la-lua.lo -MD -MP -MF engine/.deps/libmodsecurity_la-lua.Tpo -c engine/lua.cc -fPIC -DPIC -o engine/.libs/libmodsecurity_la-lua.o
engine/lua.cc: In member function 'bool modsecurity::engine::Lua::load(std::string, std::string*)':
engine/lua.cc:86:75: error: too many arguments to function 'int lua_dump(lua_State*, lua_Writer, void*)'
if (lua_dump(L, Lua::blob_keeper, reinterpret_cast<void *>(&m_blob), 0)) {
^
In file included from /usr/include/lua.hpp:6:0,
from ../src/engine/lua.h:17,
from engine/lua.cc:17:
/usr/include/lua.h:207:14: note: declared here
LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data);
^
engine/lua.cc: In member function 'int modsecurity::engine::Lua::run(modsecurity::Transaction*)':
engine/lua.cc:136:34: error: 'luaL_setfuncs' was not declared in this scope
luaL_setfuncs(L, mscLuaLib, 0);
^
engine/lua.cc:140:13: error: too many arguments to function 'int lua_load(lua_State*, lua_Reader, void*, const char*)'
NULL);
^
In file included from /usr/include/lua.hpp:6:0,
from ../src/engine/lua.h:17,
from engine/lua.cc:17:
/usr/include/lua.h:204:16: note: declared here
LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt,
^
engine/lua.cc:141:15: error: 'LUA_OK' was not declared in this scope
if (rc != LUA_OK) {
^
engine/lua.cc:151:18: error: 'LUA_ERRGCMM' was not declared in this scope
case LUA_ERRGCMM:
^
engine/lua.cc: In static member function 'static std::string modsecurity::engine::Lua::applyTransformations(lua_State*, modsecurity::Transaction*, int, std::string)':
engine/lua.cc:364:37: error: 'lua_rawlen' was not declared in this scope
int i, n = lua_rawlen(L, idx);
^
make[2]: *** [engine/libmodsecurity_la-lua.lo] Error 1
Probably this has to do with the Lua version as the standard one in centos7 is 5.1 Ref: https://github.com/jeremyong/Selene/issues/108 So modsec v3 needs Lua 5.2+?
It seems to need Lua 5.3. I find this is bad as there are only most of RHEL 7.X repo still have Lua 5.1.4 as the latest. See #1622
Is there a way we can probably embed the lua in the libmodsecurity.so ,so we dont have to ship the lua along with the binary instead of lua being a shared library?
LUA 5.3 is currently required. A simplified rationale is here: https://github.com/SpiderLabs/ModSecurity/issues/1622#issuecomment-346687983
There's experimental support on LUA 5.2 at #1623.
If you want to manually disable LUA support use ./configure --without-lua or ./configure --with-lua=no
ModSecurity V3/master branch
I see that lua support is now available. on a centos7 I am getting
I have the lua rpm's installed