mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-06 17:20:49 +00:00
update(userspace/engine): propagate compiler warnings
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
@@ -447,20 +447,28 @@ bool rule_loader::compiler::compile_condition(
|
||||
// skip the rule silently if skip_if_unknown_filter is true and
|
||||
// we encountered some specific kind of errors
|
||||
std::string err = e.what();
|
||||
rule_loader::context ctx(compiler.get_pos(), condition, cond_ctx);
|
||||
if(err_is_unknown_type_or_field(err) && allow_unknown_fields)
|
||||
{
|
||||
cfg.res->add_warning(
|
||||
falco::load_result::load_result::LOAD_UNKNOWN_FILTER,
|
||||
err,
|
||||
cond_ctx);
|
||||
ctx);
|
||||
return false;
|
||||
}
|
||||
rule_loader::context ctx(compiler.get_pos(), condition, cond_ctx);
|
||||
throw rule_loader::rule_load_exception(
|
||||
falco::load_result::load_result::LOAD_ERR_COMPILE_CONDITION,
|
||||
err,
|
||||
ctx);
|
||||
}
|
||||
for (const auto &w : compiler.get_warnings())
|
||||
{
|
||||
rule_loader::context ctx(w.pos, condition, cond_ctx);
|
||||
cfg.res->add_warning(
|
||||
falco::load_result::load_result::LOAD_COMPILE_CONDITION,
|
||||
w.msg,
|
||||
ctx);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user