From 2660dd8e0351d6652ffbac08a12d4e4d3d127387 Mon Sep 17 00:00:00 2001 From: Federico Stagni Date: Mon, 18 May 2026 17:38:27 +0200 Subject: [PATCH] fix: adding the owner-write bit to bundled files --- .../FrameworkSystem/Service/BundleDeliveryHandler.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/DIRAC/FrameworkSystem/Service/BundleDeliveryHandler.py b/src/DIRAC/FrameworkSystem/Service/BundleDeliveryHandler.py index 362904eee3d..23b198eb9f9 100644 --- a/src/DIRAC/FrameworkSystem/Service/BundleDeliveryHandler.py +++ b/src/DIRAC/FrameworkSystem/Service/BundleDeliveryHandler.py @@ -72,9 +72,16 @@ def updateBundles(self): Path(os.path.commonpath(paths)).parent if len(paths) == 1 else Path(os.path.commonpath(paths)) ) gLogger.info(f"Bundle will have {len(filesToBundle)} files with common path {commonParent}") + + def _makeWritable(tarinfo): + # Ensure files are extracted as writable so subsequent syncs can overwrite them. + # by setting the owner-write bit (0o200) + tarinfo.mode |= 0o200 + return tarinfo + with tarfile.open("dummy", "w:gz", buffer_) as tarBuffer: for p in paths: - tarBuffer.add(str(p), str(p.relative_to(commonParent))) + tarBuffer.add(str(p), str(p.relative_to(commonParent)), filter=_makeWritable) zippedData = buffer_.getvalue() buffer_.close() hash_ = File.getMD5ForFiles(filesToBundle)