Skip to content

Commit 3e14a9a

Browse files
author
Marc Stern
authored
Merge branch 'SpiderLabs:v2/master' into v2/master
2 parents e9bf697 + c060ab9 commit 3e14a9a

File tree

3 files changed

+65
-57
lines changed

3 files changed

+65
-57
lines changed

CHANGES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
DD mmm YYYY - 2.9.x (to be released)
22
-------------------
33

4+
* Allow lua version 5.4
5+
[Issue #2996 - @3eka, @martinhsv]
6+
* Configure: do not check for pcre1 if pcre2 requested
7+
[Issue #2975 - @zhaoshikui, @martinhsv]
48
* Check return code of apr_procattr_io_set()
59
[Issue #2958 - @marcstern]
610
* Do not escape special chars in rx pattern with macro

apache2/msc_lua.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,12 +429,12 @@ int lua_execute(msc_script *script, char *param, modsec_rec *msr, msre_rule *rul
429429
#else
430430

431431
/* Create new state. */
432-
#if LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503 || LUA_VERSION_NUM == 501
432+
#if LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503 || LUA_VERSION_NUM == 504 || LUA_VERSION_NUM == 501
433433
L = luaL_newstate();
434434
#elif LUA_VERSION_NUM == 500
435435
L = lua_open();
436436
#else
437-
#error We are only tested under Lua 5.0, 5.1, 5.2, or 5.3.
437+
#error We are only tested under Lua 5.0, 5.1, 5.2, 5.3, or 5.4.
438438
#endif
439439
luaL_openlibs(L);
440440

@@ -459,10 +459,10 @@ int lua_execute(msc_script *script, char *param, modsec_rec *msr, msre_rule *rul
459459
/* Register functions. */
460460
#if LUA_VERSION_NUM == 500 || LUA_VERSION_NUM == 501
461461
luaL_register(L, "m", mylib);
462-
#elif LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503
462+
#elif LUA_VERSION_NUM == 502 || LUA_VERSION_NUM == 503 || LUA_VERSION_NUM == 504
463463
luaL_setfuncs(L, mylib, 0);
464464
#else
465-
#error We are only tested under Lua 5.0, 5.1, 5.2, or 5.3.
465+
#error We are only tested under Lua 5.0, 5.1, 5.2, 5.3, or 5.4.
466466
#endif
467467

468468
lua_setglobal(L, "m");

build/find_pcre.m4

Lines changed: 57 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -21,69 +21,73 @@ AC_ARG_WITH(
2121
[test_paths="${with_pcre}"],
2222
[test_paths="/usr/local/libpcre /usr/local/pcre /usr/local /opt/libpcre /opt/pcre /opt /usr"])
2323
24-
AC_MSG_CHECKING([for libpcre config script])
25-
26-
dnl # Determine pcre lib directory
27-
if test -z "${with_pcre}"; then
28-
test_paths="/usr/local/pcre /usr/local /usr"
24+
if test "x${with_pcre2}" != "x" && test "x${with_pcre2}" != "xno"; then
25+
AC_MSG_NOTICE([pcre2 specified; omitting check for pcre])
2926
else
30-
test_paths="${with_pcre}"
31-
fi
27+
AC_MSG_CHECKING([for libpcre config script])
3228
33-
for x in ${test_paths}; do
34-
dnl # Determine if the script was specified and use it directly
35-
if test ! -d "$x" -a -e "$x"; then
36-
PCRE_CONFIG=$x
37-
pcre_path="no"
38-
break
29+
dnl # Determine pcre lib directory
30+
if test -z "${with_pcre}"; then
31+
test_paths="/usr/local/pcre /usr/local /usr"
32+
else
33+
test_paths="${with_pcre}"
3934
fi
4035
41-
dnl # Try known config script names/locations
42-
for PCRE_CONFIG in pcre-config; do
43-
if test -e "${x}/bin/${PCRE_CONFIG}"; then
44-
pcre_path="${x}/bin"
36+
for x in ${test_paths}; do
37+
dnl # Determine if the script was specified and use it directly
38+
if test ! -d "$x" -a -e "$x"; then
39+
PCRE_CONFIG=$x
40+
pcre_path="no"
4541
break
46-
elif test -e "${x}/${PCRE_CONFIG}"; then
47-
pcre_path="${x}"
42+
fi
43+
44+
dnl # Try known config script names/locations
45+
for PCRE_CONFIG in pcre-config; do
46+
if test -e "${x}/bin/${PCRE_CONFIG}"; then
47+
pcre_path="${x}/bin"
48+
break
49+
elif test -e "${x}/${PCRE_CONFIG}"; then
50+
pcre_path="${x}"
51+
break
52+
else
53+
pcre_path=""
54+
fi
55+
done
56+
if test -n "$pcre_path"; then
4857
break
49-
else
50-
pcre_path=""
5158
fi
5259
done
53-
if test -n "$pcre_path"; then
54-
break
55-
fi
56-
done
5760
58-
if test -n "${pcre_path}"; then
59-
if test "${pcre_path}" != "no"; then
60-
PCRE_CONFIG="${pcre_path}/${PCRE_CONFIG}"
61+
if test -n "${pcre_path}"; then
62+
if test "${pcre_path}" != "no"; then
63+
PCRE_CONFIG="${pcre_path}/${PCRE_CONFIG}"
64+
fi
65+
AC_MSG_RESULT([${PCRE_CONFIG}])
66+
PCRE_VERSION="`${PCRE_CONFIG} --version`"
67+
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(pcre VERSION: $PCRE_VERSION); fi
68+
PCRE_CFLAGS="`${PCRE_CONFIG} --cflags`"
69+
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(pcre CFLAGS: $PCRE_CFLAGS); fi
70+
PCRE_LDADD="`${PCRE_CONFIG} --libs`"
71+
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(pcre LDADD: $PCRE_LDADD); fi
72+
PCRE_LD_PATH="/`${PCRE_CONFIG} --libs | cut -d'/' -f2,3,4,5,6 | cut -d ' ' -f1`"
73+
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(pcre PCRE_LD_PATH: $PCRE_LD_PATH); fi
74+
else
75+
AC_MSG_RESULT([no])
6176
fi
62-
AC_MSG_RESULT([${PCRE_CONFIG}])
63-
PCRE_VERSION="`${PCRE_CONFIG} --version`"
64-
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(pcre VERSION: $PCRE_VERSION); fi
65-
PCRE_CFLAGS="`${PCRE_CONFIG} --cflags`"
66-
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(pcre CFLAGS: $PCRE_CFLAGS); fi
67-
PCRE_LDADD="`${PCRE_CONFIG} --libs`"
68-
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(pcre LDADD: $PCRE_LDADD); fi
69-
PCRE_LD_PATH="/`${PCRE_CONFIG} --libs | cut -d'/' -f2,3,4,5,6 | cut -d ' ' -f1`"
70-
if test "$verbose_output" -eq 1; then AC_MSG_NOTICE(pcre PCRE_LD_PATH: $PCRE_LD_PATH); fi
71-
else
72-
AC_MSG_RESULT([no])
73-
fi
7477
75-
AC_SUBST(PCRE_CONFIG)
76-
AC_SUBST(PCRE_VERSION)
77-
AC_SUBST(PCRE_CPPFLAGS)
78-
AC_SUBST(PCRE_CFLAGS)
79-
AC_SUBST(PCRE_LDFLAGS)
80-
AC_SUBST(PCRE_LDADD)
81-
AC_SUBST(PCRE_LD_PATH)
78+
AC_SUBST(PCRE_CONFIG)
79+
AC_SUBST(PCRE_VERSION)
80+
AC_SUBST(PCRE_CPPFLAGS)
81+
AC_SUBST(PCRE_CFLAGS)
82+
AC_SUBST(PCRE_LDFLAGS)
83+
AC_SUBST(PCRE_LDADD)
84+
AC_SUBST(PCRE_LD_PATH)
8285
83-
if test -z "${PCRE_VERSION}"; then
84-
AC_MSG_NOTICE([*** pcre library not found.])
85-
else
86-
AC_MSG_NOTICE([using pcre v${PCRE_VERSION}])
87-
ifelse([$1], , , $1)
88-
fi
86+
if test -z "${PCRE_VERSION}"; then
87+
AC_MSG_NOTICE([*** pcre library not found.])
88+
else
89+
AC_MSG_NOTICE([using pcre v${PCRE_VERSION}])
90+
ifelse([$1], , , $1)
91+
fi
92+
fi
8993
])

0 commit comments

Comments
 (0)