Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spack stages file/directory permissions hardcoded to 700 #20266

Closed
BenWeber42 opened this issue Dec 7, 2020 · 0 comments · Fixed by #21425
Closed

Spack stages file/directory permissions hardcoded to 700 #20266

BenWeber42 opened this issue Dec 7, 2020 · 0 comments · Fixed by #21425

Comments

@BenWeber42
Copy link
Contributor

Currently, the spack stages directory & file permissions are set to 700. I believe this is only due to historical reasons.

Basically, this behavior was added here be7c5f6#diff-ef561cde79864134a9c7c4fd5746f04535ebcf460065d212ba2d5d07986b9e93. I can only assume that someone noticed that the file permissions for temporary files are 700 by default and so ported this behavior also for normal stage directories.

Later on, temporary stage directories were removed here #12072 and now normal stage directories are stuck with hardcoded 700 file permissions.

This is overly restrictive and an issue if one wants to inspect someone else's stage directory (e.g., to look at the build log). Specifically, we use jenkins to build spack packages nightly. When they fail, the build logs are only accessible to the jenkins user.

Permissions of the install directories are configurable (https://spack.readthedocs.io/en/latest/build_settings.html#package-permissions) whereas stage directories have hardcoded permissions:

def create(self):
"""
Ensures the top-level (config:build_stage) directory exists.
"""
# Emulate file permissions for tempfile.mkdtemp.
if not os.path.exists(self.path):
mkdirp(self.path, mode=stat.S_IRWXU)
elif not os.path.isdir(self.path):
os.remove(self.path)
mkdirp(self.path, mode=stat.S_IRWXU)
# Make sure we can actually do something with the stage we made.
ensure_access(self.path)
self.created = True

I think at least group members should get read permissions. Possibly this should also be configurable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants