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
I haven't experienced this thankfully, but when working on our cache code I noticed that there are a couple of places where we remove all files in a directory, and all files in all subdirectories. This could be really dangerous if somebody incorrectly sets their cache dir (e.g. in nengorc) and then has all the files in that directory deleted.
Expected behavior
One solution would be to have some sort of naming convention and/or extension, and only remove files that match that. That could extend to directories, too (i.e. we'd only recurse into/delete directories matching the naming convention).
Another solution (that could be instead of or in addition to the first) would be to have the decoder_cache.path in nengorc just specify the base of the path (e.g. ~/.cache/nengo) and then within that we make a decoders folder (or something like that), and we only touch files in that subfolder. That way, even if somebody set their path to ~, we'd still make a decoders folder and add/delete things there, rather than potentially deleting all files in their home directory.
The text was updated successfully, but these errors were encountered:
Describe the bug
I haven't experienced this thankfully, but when working on our cache code I noticed that there are a couple of places where we remove all files in a directory, and all files in all subdirectories. This could be really dangerous if somebody incorrectly sets their cache dir (e.g. in
nengorc
) and then has all the files in that directory deleted.Expected behavior
One solution would be to have some sort of naming convention and/or extension, and only remove files that match that. That could extend to directories, too (i.e. we'd only recurse into/delete directories matching the naming convention).
Another solution (that could be instead of or in addition to the first) would be to have the
decoder_cache.path
innengorc
just specify the base of the path (e.g.~/.cache/nengo
) and then within that we make adecoders
folder (or something like that), and we only touch files in that subfolder. That way, even if somebody set their path to~
, we'd still make adecoders
folder and add/delete things there, rather than potentially deleting all files in their home directory.The text was updated successfully, but these errors were encountered: