Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conf: zlog_init doesn't return an error when given a non-regular file path for initialization #278

Open
iancuivasciuc opened this issue Nov 10, 2024 · 0 comments · May be fixed by #279
Open

Comments

@iancuivasciuc
Copy link

iancuivasciuc commented Nov 10, 2024

When zlog_init is given a path to a non-regular file, it doesn't return an error. Instead, the logger is configured as if it was given an empty file.

For example, consider the following:

zlog_init("/etc/zlog.conf")  // no error, works fine
zlog_init("/etc/zlog.con")   // error, works fine
zlog_init("/etc")            // no error ???

Shouldn't an error be returned in the last case?

iancuivasciuc added a commit to iancuivasciuc/zlog that referenced this issue Nov 10, 2024
Currently, calling zlog_init with a non-regular file (e.g., a directory)
didn’t return an error. The logger would have been configured the same
as with an empty file.

The file is now checked to ensure it is regular, and an error is returned
if it is not.

Fixes HardySimpson#278.
iancuivasciuc added a commit to iancuivasciuc/zlog that referenced this issue Nov 14, 2024
Currently, calling zlog_init with a non-regular file (e.g., a directory)
didn’t return an error. The logger would have been configured the same
as with an empty file.

The file is now checked to ensure it is regular, and an error is returned
if it is not.

Fixes HardySimpson#278.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant