Reuse already initialized rule set for each location - #291
Conversation
Only merge rulesets when there are extra rules in the location, otherwise just re-use the ruleset of the parent
|
Hi @k1k, we've added a CI workflow to this repository. Could you pick up the modifications and send your patch again? It would be fine to run those tests - thanks! |
|
The lazy/shared ruleset approach is reasonable, but it changes the behavior of modsecurity on without any loaded rules. Both parent and child rulesets can remain NULL, ngx_http_modsecurity_create_ctx() then returns NULL, and the rewrite handler turns that into HTTP 500. Previously every location had a valid empty RulesSet. Please preserve the empty-ruleset behavior for enabled configurations. Also, the DDEBUG dumps currently run before the new NULL checks, while msc_rules_dump() dereferences its argument unconditionally, causing debug builds to crash during configuration merging. |
|



Only merge rule-sets when there are extra rules in the location, otherwise just re-use the rule-set of the parent