mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-01 22:58:12 +00:00
Fix logic for detecting conf files.
The logic for detecting if a file exists was backwards. It would treat a file as existing if it could *not* be opened. Reverse that logic so it works. This fixes https://github.com/draios/falco/issues/135.
This commit is contained in:
@@ -337,14 +337,14 @@ int falco_init(int argc, char **argv)
|
||||
else
|
||||
{
|
||||
conf_stream.open(FALCO_SOURCE_CONF_FILE);
|
||||
if (!conf_stream.is_open())
|
||||
if (conf_stream.is_open())
|
||||
{
|
||||
conf_filename = FALCO_SOURCE_CONF_FILE;
|
||||
}
|
||||
else
|
||||
{
|
||||
conf_stream.open(FALCO_INSTALL_CONF_FILE);
|
||||
if (!conf_stream.is_open())
|
||||
if (conf_stream.is_open())
|
||||
{
|
||||
conf_filename = FALCO_INSTALL_CONF_FILE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user