You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The _save_old() to return early if <filename> is not file (or symlink
to a file).
This is simplest alternative to avoid attempt to rename /dev/null
(which could succeed).
This also keeps fifos (perhaps nonexistent potential usage but
this is nicer).
If <filename> were directory or socket, after shutil.copyfile(),
writing to the file (by caller, _write_config()), would fail.
Fixes#31362
Co-authored-by: Marti Bolivar <[email protected]>
Signed-off-by: Tomi Ollila <[email protected]>
Describe the bug
the kconfiglib.py _save_old("/dev/null") may actually, unexpectly, succeed.
afterwards /dev/null was opened for writing as a (new) file
To Reproduce
Steps to reproduce the behavior:
Expected behavior
/dev/null is still device node
Impact
/dev/null is a file, with kconfig content
What impact does this issue have on your progress
host code that opened /dev/null as config file got "garbage"
Environment (please complete the following information):
zephyr v1.14 -- but after investigating main in 2021-01 it still can happen
** how to fix **
if not os.path.isfile(path) return
to skip rename if path does not point to a file(either directly, or via symlink)
The text was updated successfully, but these errors were encountered: