feat: added Lua5.5 support#3525
Merged
airween merged 3 commits intoowasp-modsecurity:v3/masterfrom Mar 28, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds build/runtime accommodations for Lua 5.5 so libmodsecurity3 can compile and pass regression tests on platforms that ship Lua 5.5 (e.g., macOS).
Changes:
- Extend
build/lua.m4to detect/link Lua 5.5 and defineWITH_LUA_5_5. - Update Lua engine error-handling to avoid referencing
LUA_ERRGCMMwhen building against Lua 5.5. - Adjust a Lua regression-test helper script to avoid mutating generic-for iterator variables (Lua 5.5 behavior).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| build/lua.m4 | Adds Lua 5.5 library candidates + version detection/defines. |
| src/engine/lua.cc | Excludes LUA_ERRGCMM switch case when compiling with Lua 5.5. |
| test/test-cases/data/match-getvars.lua | Updates table-dump helper to avoid mutating loop iterator variables. |
Comments suppressed due to low confidence (1)
build/lua.m4:47
- The Lua version compile tests have a logic bug for Lua 5.5:
_msc_lua_veris set to 505 by the 5.5 check, but the subsequent 5.4AC_COMPILE_IFELSEruns unconditionally and will fail on 5.5, resetting_msc_lua_verto empty and preventing detection. Gate the 5.4 (and subsequent) checks behindif test -z "$_msc_lua_ver"; then ... fior rewrite these as an if/elif chain so a successful match isn’t overwritten.
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <lua.h> ]],
[[ #if (LUA_VERSION_NUM == 504)
return 0;
#else
#error not 5.4
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
fzipi
approved these changes
Mar 28, 2026
ad8b8a8
into
owasp-modsecurity:v3/master
125 of 126 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



what
This PR adds Lua5.5 support.
Steps of implementation:
build/lua.m4lua.ccI had to add this version as an exceptiontest/test-cases/data/match-getvars.luawhich is used in one of the regression test with operator@inspectFile. Lua5.5 does not allow to change the iterator variable's value, so we need to create a local variable.why
Lua5.5 was released and added to macOS, where we also run regression tests. Tests were failed there because Lua5.5 wasn't supported in libmodsecurity3.
references
Closes #3523