mirror of
https://github.com/falcosecurity/falco.git
synced 2025-08-30 12:30:56 +00:00
fix(userspace/falco): require config file only when needed
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
parent
149c95c3fb
commit
4aefb7fd7d
@ -33,7 +33,15 @@ application::run_result application::load_config()
|
||||
}
|
||||
falco_logger::log(LOG_INFO, "Falco initialized with configuration file: " + m_options.conf_filename + "\n");
|
||||
}
|
||||
else
|
||||
|
||||
m_state->config->m_buffered_outputs = !m_options.unbuffered_outputs;
|
||||
|
||||
return run_result::ok();
|
||||
}
|
||||
|
||||
application::run_result application::require_config_file()
|
||||
{
|
||||
if (m_options.conf_filename.empty())
|
||||
{
|
||||
#ifndef BUILD_TYPE_RELEASE
|
||||
return run_result::fatal(std::string("You must create a config file at ") + FALCO_SOURCE_CONF_FILE + ", " + FALCO_INSTALL_CONF_FILE + " or by passing -c");
|
||||
@ -41,8 +49,5 @@ application::run_result application::load_config()
|
||||
return run_result::fatal(std::string("You must create a config file at ") + FALCO_INSTALL_CONF_FILE + " or by passing -c");
|
||||
#endif
|
||||
}
|
||||
|
||||
m_state->config->m_buffered_outputs = !m_options.unbuffered_outputs;
|
||||
|
||||
return run_result::ok();
|
||||
}
|
||||
}
|
@ -181,6 +181,7 @@ bool application::run(std::string &errstr, bool &restart)
|
||||
std::bind(&application::print_generated_gvisor_config, this),
|
||||
std::bind(&application::print_ignored_events, this),
|
||||
std::bind(&application::print_syscall_events, this),
|
||||
std::bind(&application::require_config_file, this),
|
||||
std::bind(&application::print_plugin_info, this),
|
||||
std::bind(&application::list_plugins, this),
|
||||
std::bind(&application::load_plugins, this),
|
||||
|
@ -315,6 +315,7 @@ private:
|
||||
run_result list_fields();
|
||||
run_result list_plugins();
|
||||
run_result load_config();
|
||||
run_result require_config_file();
|
||||
run_result load_plugins();
|
||||
run_result load_rules_files();
|
||||
run_result create_requested_paths();
|
||||
|
Loading…
Reference in New Issue
Block a user