-
Notifications
You must be signed in to change notification settings - Fork 275
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
ngclient: throws securesystemslib errors #1761
Comments
also I think the What I mean with when TUF is being used correctly:
|
That sounds bad and we should make sure we do atomic operations. |
in context of this issue and target persistence: I wanted to say that it seems like it's not actually critical how target files are written to disk. A plain If someone has a counter argument to that I'd be interested in hearing it. |
Filesystem abstraction was implemented for repository related code, I agree with the assertion that this seems unnecessary in the context of the client. Simpler use of standard file move methods seems like a reasonable decision. Separately, it would be worth investigating whether the write/flush/fsync in securesystemslib is even necessary for the modern Python versions we support (it was copy/pasted from old code and written when we were supporting Python 2.7). The Python standard library is constantly evolving and, for example, since Python 3.8 a file copy may happen entirely within the OS kernel (avoiding user space buffers). |
If ngclient fails to write a target file to disk, we let securesystemslib.exceptions.StorageError propagate.
This seems like a bug: we should either handle this error, or possibly not use the
securesystemslib.util.persist_temp_file()
at all (it's not super useful to us as we're not using the storage abstraction and the rest is a few lines of code that actually hides the error we'd really like to get: OSError which we already use for metadata files in the same situation).The text was updated successfully, but these errors were encountered: