mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-24 19:38:52 +00:00
new(userspace,unit_tests): deny main config to include itself.
Moreover, added a couple more tests. Signed-off-by: Federico Di Pierro <nierro92@gmail.com> Co-authored-by: Melissa Kilby <melissa.kilby.oss@gmail.com>
This commit is contained in:
committed by
poiana
parent
8112f6210b
commit
45754fda9f
@@ -109,6 +109,10 @@ public:
|
||||
{
|
||||
include_file_path = config_folder / include_file;
|
||||
}
|
||||
if (include_file_path == ppath)
|
||||
{
|
||||
throw std::runtime_error("Config error: 'includes' directive tried to recursively include main config file: " + path + ".");
|
||||
}
|
||||
if (std::filesystem::exists(include_file_path) && std::filesystem::is_regular_file(include_file_path))
|
||||
{
|
||||
auto loaded_nodes = load_from_file_int(include_file_path.string());
|
||||
|
Reference in New Issue
Block a user