diff --git a/mod_security.spec b/mod_security.spec index df19f35e95ec6fc2ed87507b6c11839198e13481..8a0eecec71388981392cd79d802540ffa12fecd5 100644 --- a/mod_security.spec +++ b/mod_security.spec @@ -7,7 +7,7 @@ Name: mod_security Version: 2.9.5 -Release: 1 +Release: 2 Summary: Security module for the Apache HTTP Server License: ASL 2.0 URL: http://www.modsecurity.org/ @@ -15,6 +15,7 @@ Source: https://github.com/SpiderLabs/ModSecurity/releases/download/v%{version}/ Source1: mod_security.conf Source2: 10-mod_security.conf Source3: modsecurity_localrules.conf +Patch0000: modsecurity-2.9.5-lua-54.patch Requires: httpd httpd-mmn = %{_httpd_mmn} BuildRequires: gcc make perl-generators httpd-devel yajl yajl-devel @@ -97,6 +98,9 @@ install -m0755 mlogc/mlogc-batch-load.pl %{buildroot}%{_bindir}/mlogc-batch-load %endif %changelog +* Fri Jan 7 liyanan - 2.9.5-2 +- Fix build fail with lua 5.4.3 + * Tue Dec 14 2021 yaoxin - 2.9.5-1 - Upgrade mod_security to 2.9.5 for fix CVE-2021-42717 diff --git a/modsecurity-2.9.5-lua-54.patch b/modsecurity-2.9.5-lua-54.patch new file mode 100644 index 0000000000000000000000000000000000000000..62dd671b02a0f3c01e79822bd637a84f14065bd9 --- /dev/null +++ b/modsecurity-2.9.5-lua-54.patch @@ -0,0 +1,31 @@ +diff -ru modsecurity-2.9.5/apache2/msc_lua.c modsecurity-2.9.5-lua-patch/apache2/msc_lua.c +--- modsecurity-2.9.5/apache2/msc_lua.c 2018-12-04 18:49:37.000000000 +0000 ++++ modsecurity-2.9.5-lua-patch/apache2/msc_lua.c 2020-08-08 16:55:14.936045777 +0000 +@@ -429,12 +429,12 @@ + #else + + /* Create new state. */ +-#if LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503 || LUA_VERSION_NUM == 501 ++#if LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503 || LUA_VERSION_NUM == 501 || LUA_VERSION_NUM == 504 + L = luaL_newstate(); + #elif LUA_VERSION_NUM == 500 + L = lua_open(); + #else +-#error We are only tested under Lua 5.0, 5.1, 5.2, or 5.3. ++#error We are only tested under Lua 5.0, 5.1, 5.2, 5.3 or 5.4. + #endif + luaL_openlibs(L); + +@@ -459,10 +459,10 @@ + /* Register functions. */ + #if LUA_VERSION_NUM == 500 || LUA_VERSION_NUM == 501 + luaL_register(L, "m", mylib); +-#elif LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503 ++#elif LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503 || LUA_VERSION_NUM == 504 + luaL_setfuncs(L, mylib, 0); + #else +-#error We are only tested under Lua 5.0, 5.1, 5.2, or 5.3. ++#error We are only tested under Lua 5.0, 5.1, 5.2, 5.3 or 5.4. + #endif + + lua_setglobal(L, "m");