mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-05 16:50:34 +00:00
chore(userspace/engine): introduce proper check to avoid future issues throwing an exception.
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
This commit is contained in:
committed by
poiana
parent
7bcbc08b52
commit
7879920570
@@ -226,7 +226,13 @@ std::unique_ptr<load_result> falco_engine::load_rules(const std::string &rules_c
|
||||
}
|
||||
|
||||
auto source = find_source(rule.source);
|
||||
m_rules.insert(rule, rule.name);
|
||||
auto rule_id = m_rules.insert(rule, rule.name);
|
||||
if (rule_id != rule.id)
|
||||
{
|
||||
throw falco_exception("Incompatible ID for rule: " + rule.name +
|
||||
" | compiled ID: " + std::to_string(rule.id) +
|
||||
" | stats_mgr ID: " + std::to_string(rule_id));
|
||||
}
|
||||
|
||||
// By default rules are enabled/disabled for the default ruleset
|
||||
// skip the rule if below the minimum priority
|
||||
|
Reference in New Issue
Block a user