mirror of
https://github.com/falcosecurity/falco.git
synced 2025-06-30 00:22:15 +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:
parent
5f9f5c47d1
commit
ae7f5eb631
@ -337,14 +337,14 @@ int falco_init(int argc, char **argv)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
conf_stream.open(FALCO_SOURCE_CONF_FILE);
|
conf_stream.open(FALCO_SOURCE_CONF_FILE);
|
||||||
if (!conf_stream.is_open())
|
if (conf_stream.is_open())
|
||||||
{
|
{
|
||||||
conf_filename = FALCO_SOURCE_CONF_FILE;
|
conf_filename = FALCO_SOURCE_CONF_FILE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
conf_stream.open(FALCO_INSTALL_CONF_FILE);
|
conf_stream.open(FALCO_INSTALL_CONF_FILE);
|
||||||
if (!conf_stream.is_open())
|
if (conf_stream.is_open())
|
||||||
{
|
{
|
||||||
conf_filename = FALCO_INSTALL_CONF_FILE;
|
conf_filename = FALCO_INSTALL_CONF_FILE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user