Skip to content

Commit 6777ff3

Browse files
committed
Makes it compatible with ModSecurity 2.0.3
1 parent dc654ce commit 6777ff3

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/ngx_http_modsecurity_common.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,21 @@
2424

2525
#include <modsecurity/modsecurity.h>
2626
#include <modsecurity/transaction.h>
27+
28+
29+
/* #define MSC_USE_RULES_SET 1 */
30+
31+
#if defined(MODSECURITY_CHECK_VERSION)
32+
#if MODSECURITY_VERSION_NUM >= 304010
33+
#define MSC_USE_RULES_SET 1
34+
#endif
35+
#endif
36+
37+
#if defined(MSC_USE_RULES_SET)
2738
#include <modsecurity/rules_set.h>
39+
#else
40+
#include <modsecurity/rules.h>
41+
#endif
2842

2943

3044
/**
@@ -97,7 +111,8 @@ typedef struct {
97111

98112
typedef struct {
99113
void *pool;
100-
RulesSet *rules_set;
114+
/* RulesSet or Rules */
115+
void *rules_set;
101116

102117
ngx_flag_t enable;
103118
#if defined(MODSECURITY_SANITY_CHECKS) && (MODSECURITY_SANITY_CHECKS)

0 commit comments

Comments
 (0)