mirror of
https://github.com/falcosecurity/falco.git
synced 2025-08-28 10:51:24 +00:00
new(engine): enforce unique exceptions names
Signed-off-by: Gianmatteo Palmieri <mail@gian.im>
This commit is contained in:
parent
05e6e3038c
commit
05c434ed89
@ -316,6 +316,13 @@ static void read_rule_exceptions(
|
|||||||
rule_loader::rule_exception_info v_ex(ex_ctx);
|
rule_loader::rule_exception_info v_ex(ex_ctx);
|
||||||
v_ex.name = name;
|
v_ex.name = name;
|
||||||
|
|
||||||
|
// Check if an exception with the same name has already been defined
|
||||||
|
for (auto &exception : exceptions)
|
||||||
|
{
|
||||||
|
THROW((v_ex.name == exception.name),
|
||||||
|
"Exceptions names in the same object must be unique", ex_ctx);
|
||||||
|
}
|
||||||
|
|
||||||
// note: the legacy lua loader used to throw a "xxx must strings" error
|
// note: the legacy lua loader used to throw a "xxx must strings" error
|
||||||
|
|
||||||
// fields are optional when append is true
|
// fields are optional when append is true
|
||||||
|
Loading…
Reference in New Issue
Block a user