summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2020-04-20 10:16:16 +0200
committerJürg Billeter <j@bitron.ch>2020-04-20 10:16:16 +0200
commit5bcf39fd00a18e039b6cacca05ad02ba0044addc (patch)
treeda2f2e7f9b5127e1bf07f7679049be41eb52243a
parent5c4e7b360830f8dd40874514b74e5e087e17599e (diff)
downloadbuildstream-juerg/artifact-blob-not-found-debug.tar.gz
_casbaseddirectory.py: Fix temp file permissiosn in open_file()juerg/artifact-blob-not-found-debug
This is required when buildbox-casd is running as separate user.
-rw-r--r--src/buildstream/storage/_casbaseddirectory.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/buildstream/storage/_casbaseddirectory.py b/src/buildstream/storage/_casbaseddirectory.py
index b8b5ca09c..e33bdc3d7 100644
--- a/src/buildstream/storage/_casbaseddirectory.py
+++ b/src/buildstream/storage/_casbaseddirectory.py
@@ -754,6 +754,8 @@ class CasBasedDirectory(Directory):
raise FileExistsError("{} already exists in {}".format(path[-1], str(subdir)))
with utils._tempnamedfile(mode, encoding=encoding, dir=self.cas_cache.tmpdir) as f:
+ # Make sure the temporary file is readable by buildbox-casd
+ os.chmod(f.name, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH)
yield f
# Import written temporary file into CAS
f.flush()