Skip to content

Commit 3c41751

Browse files
defanatorFelipe Zimmerle
authored and
Felipe Zimmerle
committed
Implemented merge_ruleengine_value() for RuleEngine
This change makes the SecRuleEngine directive to be merged properly.
1 parent 161c256 commit 3c41751

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

headers/modsecurity/rules_properties.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@
4242
to = (from == PropertyNotSetConfigBoolean) ? default : from; \
4343
}
4444

45+
#define merge_ruleengine_value(to, from, default) \
46+
if (to == PropertyNotSetRuleEngine) { \
47+
to = (from == PropertyNotSetRuleEngine) ? default : from; \
48+
}
49+
4550
#ifdef __cplusplus
4651

4752
namespace modsecurity {
@@ -349,9 +354,8 @@ class RulesProperties {
349354
return amount_of_rules;
350355
}
351356

352-
if (from->m_secRuleEngine != PropertyNotSetRuleEngine) {
353-
to->m_secRuleEngine = from->m_secRuleEngine;
354-
}
357+
merge_ruleengine_value(to->m_secRuleEngine, from->m_secRuleEngine,
358+
PropertyNotSetRuleEngine);
355359

356360
merge_boolean_value(to->m_secRequestBodyAccess,
357361
from->m_secRequestBodyAccess,

0 commit comments

Comments
 (0)