Skip to content

Commit 7a8edd9

Browse files
committed
ngclient: Advisory locking for artifacts
This should prevent issues with multiple processes trying to write at same time. Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
1 parent 6d66696 commit 7a8edd9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tuf/ngclient/updater.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ def download_target(
337337

338338
target_file.seek(0)
339339
with open(filepath, "wb") as destination_file:
340+
_lock_file(destination_file)
340341
shutil.copyfileobj(target_file, destination_file)
341342

342343
logger.debug("Downloaded target %s", targetinfo.path)

0 commit comments

Comments
 (0)