From 7a8edd98303503dbf7ea2c917430f6fcff60a6be Mon Sep 17 00:00:00 2001 From: Jussi Kukkonen Date: Fri, 22 Aug 2025 18:48:55 +0300 Subject: [PATCH] ngclient: Advisory locking for artifacts This should prevent issues with multiple processes trying to write at same time. Signed-off-by: Jussi Kukkonen --- tuf/ngclient/updater.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tuf/ngclient/updater.py b/tuf/ngclient/updater.py index a3477321..08cab467 100644 --- a/tuf/ngclient/updater.py +++ b/tuf/ngclient/updater.py @@ -337,6 +337,7 @@ def download_target( target_file.seek(0) with open(filepath, "wb") as destination_file: + _lock_file(destination_file) shutil.copyfileobj(target_file, destination_file) logger.debug("Downloaded target %s", targetinfo.path)