mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-16 01:22:18 +03:00
Makes re2 detectable by the build scripts
This commit is contained in:
@@ -316,7 +316,8 @@ libmodsecurity_la_CPPFLAGS = \
|
||||
$(SSDEEP_CFLAGS) \
|
||||
$(MAXMIND_CFLAGS) \
|
||||
$(LUA_CFLAGS) \
|
||||
$(LIBXML2_CFLAGS)
|
||||
$(LIBXML2_CFLAGS) \
|
||||
$(RE2_CFLAGS)
|
||||
|
||||
|
||||
libmodsecurity_la_LDFLAGS = \
|
||||
@@ -331,6 +332,7 @@ libmodsecurity_la_LDFLAGS = \
|
||||
$(SSDEEP_LDFLAGS) \
|
||||
$(MAXMIND_LDFLAGS) \
|
||||
$(YAJL_LDFLAGS) \
|
||||
$(RE2_LDFLAGS) \
|
||||
-version-info @MSC_VERSION_INFO@
|
||||
|
||||
|
||||
@@ -346,5 +348,6 @@ libmodsecurity_la_LIBADD = \
|
||||
$(PCRE_LDADD) \
|
||||
$(MAXMIND_LDADD) \
|
||||
$(SSDEEP_LDADD) \
|
||||
$(YAJL_LDADD)
|
||||
$(YAJL_LDADD) \
|
||||
$(RE2_LDADD)
|
||||
|
||||
|
||||
@@ -26,7 +26,8 @@ libmodsec_parser_la_CPPFLAGS = \
|
||||
$(YAJL_CFLAGS) \
|
||||
$(LMDB_CFLAGS) \
|
||||
$(PCRE_CFLAGS) \
|
||||
$(LIBXML2_CFLAGS)
|
||||
$(LIBXML2_CFLAGS) \
|
||||
$(RE2_CFLAGS)
|
||||
|
||||
test.cc: seclang-parser.hh
|
||||
cat seclang-parser.hh | sed "s/return \*new (yyas_<T> ()) T (t)/return *new (yyas_<T> ()) T (std::move((T\&)t))/g" > seclang-parser.hh.fix && mv seclang-parser.hh.fix seclang-parser.hh
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include <pcre.h>
|
||||
|
||||
|
||||
#include "src/regex/backend/pcre.h"
|
||||
#include "src/regex/regex_match.h"
|
||||
@@ -28,6 +28,7 @@ namespace modsecurity {
|
||||
namespace regex {
|
||||
namespace backend {
|
||||
|
||||
#ifdef WITH_PCRE
|
||||
|
||||
#if PCRE_HAVE_JIT
|
||||
#define pcre_study_opt PCRE_STUDY_JIT_COMPILE
|
||||
@@ -119,6 +120,7 @@ int Pcre::search(const std::string& s) const {
|
||||
s.size(), 0, 0, ovector, OVECCOUNT) > 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace backend
|
||||
} // namespace regex
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef WITH_PCRE
|
||||
#include <pcre.h>
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
@@ -29,6 +31,7 @@ namespace modsecurity {
|
||||
namespace regex {
|
||||
namespace backend {
|
||||
|
||||
#ifdef WITH_PCRE
|
||||
|
||||
#define OVECCOUNT 30
|
||||
|
||||
@@ -52,6 +55,7 @@ class Pcre {
|
||||
pcre_extra *m_pce = NULL;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
} // namespace backend
|
||||
} // namespace regex
|
||||
|
||||
@@ -30,6 +30,14 @@
|
||||
namespace modsecurity {
|
||||
namespace regex {
|
||||
|
||||
#ifdef WITH_PCRE
|
||||
using selectedBackend = backend::Pcre;
|
||||
#elif WITH_RE2
|
||||
//using selectedBackend = backend::Re2;
|
||||
#else
|
||||
#error "no regex backend selected"
|
||||
#endif
|
||||
|
||||
using selectedBackend = backend::Pcre;
|
||||
|
||||
class Regex : public selectedBackend {
|
||||
|
||||
Reference in New Issue
Block a user