Fix 'is_chained' value for final rule in chain

'is_chained' should be true for an actionset when the is_chained
member of the struct is true, or when its rule has a valid
chain_starter member.
This commit is contained in:
Robert Paprocki
2015-11-10 15:54:42 -08:00
committed by Felipe Zimmerle
parent 5bc75ec871
commit ddc25dbbaa

View File

@@ -600,7 +600,7 @@ static void write_rule_json(modsec_rec *msr, const msre_rule *rule, yajl_gen g)
if (rule->actionset->phase != NOT_SET) { if (rule->actionset->phase != NOT_SET) {
yajl_kv_int(g, "phase", rule->actionset->phase); yajl_kv_int(g, "phase", rule->actionset->phase);
} }
yajl_kv_bool(g, "is_chained", rule->actionset->is_chained); yajl_kv_bool(g, "is_chained", rule->actionset->is_chained || (rule->chain_starter != NULL));
if (rule->actionset->is_chained && (rule->chain_starter == NULL)) { if (rule->actionset->is_chained && (rule->chain_starter == NULL)) {
yajl_kv_bool(g, "chain_starter", 1); yajl_kv_bool(g, "chain_starter", 1);
} }