Skip to content

Commit d3dc066

Browse files
committed
fix: adding the owner-write bit to bundled files
1 parent 3d7bc21 commit d3dc066

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/DIRAC/FrameworkSystem/Service/BundleDeliveryHandler.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,16 @@ def updateBundles(self):
7272
Path(os.path.commonpath(paths)).parent if len(paths) == 1 else Path(os.path.commonpath(paths))
7373
)
7474
gLogger.info(f"Bundle will have {len(filesToBundle)} files with common path {commonParent}")
75+
76+
def _makeWritable(tarinfo):
77+
# Ensure files are extracted as writable so subsequent syncs can overwrite them.
78+
# by setting the owner-write bit (0o200)
79+
tarinfo.mode |= 0o200
80+
return tarinfo
81+
7582
with tarfile.open("dummy", "w:gz", buffer_) as tarBuffer:
7683
for p in paths:
77-
tarBuffer.add(str(p), str(p.relative_to(commonParent)))
84+
tarBuffer.add(str(p), str(p.relative_to(commonParent)), filter=_makeWritable)
7885
zippedData = buffer_.getvalue()
7986
buffer_.close()
8087
hash_ = File.getMD5ForFiles(filesToBundle)

0 commit comments

Comments
 (0)