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 14:27:16 +0200
commitcc087ae947c92771def5699ac49cd88b472413d7 (patch)
tree2417ee62b37ba18f49bdab204f2eac6651bdc9ed
parent442b1318bd4d38fe35770e2108bf4d963a093af3 (diff)
downloadbuildstream-cc087ae947c92771def5699ac49cd88b472413d7.tar.gz
_casbaseddirectory.py: Fix temp file permissions in open_file()
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()