mirror of
https://github.com/falcosecurity/falco.git
synced 2025-08-31 06:10:45 +00:00
fix(userspace/falco): fix create_dir behaviour
Signed-off-by: Roberto Scolaro <roberto.scolaro21@gmail.com>
This commit is contained in:
@@ -92,13 +92,15 @@ falco::app::run_result falco::app::actions::create_requested_paths(falco::app::s
|
||||
return run_result::ok();
|
||||
}
|
||||
|
||||
// This function operates like `mkdir -p` excluding the last part of
|
||||
// the path which we assume to be the filename.
|
||||
static int create_dir(const std::string &path)
|
||||
{
|
||||
|
||||
std::filesystem::path dirPath(path);
|
||||
|
||||
try {
|
||||
std::filesystem::create_directories(dirPath);
|
||||
std::filesystem::create_directories(dirPath.parent_path());
|
||||
} catch (const std::exception& ex) {
|
||||
return -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user