ngclient: persist metadata in a safer way
See original GitHub issuetuf/ngclient/updater.py: Updater._persist_metadata()
:
with open(os.path.join(self._dir, f"{rolename}.json"), "wb") as f:
f.write(data)
this is not as safe as it should be (as file could be corrupted midway through). This should work:
- write content to tempfile
- use
sslib_util.persist_temp_file()
to move tempfile to correct filepath
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Is there a way to skip persisting metadata for Spring Batch ...
Is there a way to keep metadata of the first type of jobs (e.g. reports processing) in the database while not using database...
Read more >Working with object metadata - Amazon Simple Storage Service
Name Description Can user modify the value?
Date Current date and time. No
Content‑Disposition Object presentational information. Yes
Content‑Length Object size in bytes. No
Read more >How clean is your document? What you need to know about ...
This is a safer way to go than sending Word documents, Kinas said, both in terms of obscuring the metadata and in terms...
Read more >Consider Metadata When Sending Files - Safe Computing
Metadata is data that defines or describes another piece of data. ... Privacy options heading, select Remove personal information from this file on...
Read more >Metadata Handling | dpBestflow
The most secure and efficient way to handle the metadata you create is by using catalog software. The catalog can harvest, manipulate, and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Understood, I’ll make the changes accordingly. Could you possibly assign this task to me?
Hey. I have prepared a fix to this. Should I put up a pull request on this? It’s my first open-source contribution, so any inputs will be much appreciated.