mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Make the temp directories world-readable so that docker containers can access them regardless of which user created them
This commit is contained in:
parent
429d1e3f08
commit
a711ec1ded
1 changed files with 15 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
import os
|
||||
import stat
|
||||
import platform
|
||||
import tempfile
|
||||
|
||||
|
@ -30,6 +31,20 @@ class Common(object):
|
|||
prefix=os.path.join(cache_dir, "safe-")
|
||||
)
|
||||
|
||||
# Make the folders world-readable to ensure that the container has permission
|
||||
# to access it even if it's owned by root or someone else
|
||||
permissions = (
|
||||
stat.S_IRUSR
|
||||
| stat.S_IWUSR
|
||||
| stat.S_IXUSR
|
||||
| stat.S_IRGRP
|
||||
| stat.S_IXGRP
|
||||
| stat.S_IROTH
|
||||
| stat.S_IXOTH
|
||||
)
|
||||
os.chmod(self.pixel_dir.name, permissions)
|
||||
os.chmod(self.safe_dir.name, permissions)
|
||||
|
||||
# Name of input and out files
|
||||
self.document_filename = None
|
||||
self.save_filename = None
|
||||
|
|
Loading…
Reference in a new issue