Implemented merge_ruleengine_value() for RuleEngine

This change makes the SecRuleEngine directive to be merged properly.
This commit is contained in:
Andrei Belov 2018-12-25 18:43:20 +03:00 committed by Felipe Zimmerle
parent 161c256333
commit 3c41751eda
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277

View File

@ -42,6 +42,11 @@
to = (from == PropertyNotSetConfigBoolean) ? default : from; \ to = (from == PropertyNotSetConfigBoolean) ? default : from; \
} }
#define merge_ruleengine_value(to, from, default) \
if (to == PropertyNotSetRuleEngine) { \
to = (from == PropertyNotSetRuleEngine) ? default : from; \
}
#ifdef __cplusplus #ifdef __cplusplus
namespace modsecurity { namespace modsecurity {
@ -349,9 +354,8 @@ class RulesProperties {
return amount_of_rules; return amount_of_rules;
} }
if (from->m_secRuleEngine != PropertyNotSetRuleEngine) { merge_ruleengine_value(to->m_secRuleEngine, from->m_secRuleEngine,
to->m_secRuleEngine = from->m_secRuleEngine; PropertyNotSetRuleEngine);
}
merge_boolean_value(to->m_secRequestBodyAccess, merge_boolean_value(to->m_secRequestBodyAccess,
from->m_secRequestBodyAccess, from->m_secRequestBodyAccess,