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

Add util for checking installation permissions #652

Merged
merged 4 commits into from
Jun 28, 2023

Conversation

AlexanderRichert-NOAA
Copy link
Collaborator

Summary

This PR adds a utility (with doco) for checking the permissions of installations, specifically to ensure that non-owning users/groups can access them.

Testing

Tested the functionality/logic of the utility in CentOS 8 with some dummy files.

Applications affected

No impact.

Systems affected

No impact (except for helping identify permissions problems).

Dependencies

n/a

Issue(s) addressed

n/a

Checklist

  • This PR addresses one issue/problem/enhancement, or has a very good reason for not doing so.
  • These changes have been tested on the affected systems and applications.
  • All dependency PRs/issues have been resolved and this PR can be merged.

@AlexanderRichert-NOAA
Copy link
Collaborator Author

@climbfuji let me know what you think-- I don't know if the script is portable for Macs since I can't test, but I also don't know that there will ever be a situation where a Mac user needs to worry about permissions for other users.

@climbfuji
Copy link
Collaborator

This is a neat utility, however I think what would be even better (or a good additional step) is a simple check in spack stack create env if the umask will lead to an inaccessible install (e.g. 0077 = rwx------ or 0027 = rwxr-x---)?

@AlexanderRichert-NOAA
Copy link
Collaborator Author

That sounds good-- I can think of some cases that would make it worth doing both (weird build systems; network FS quirks on Acorn). The one limitation I can think of is that creating and installing the environment could theoretically be done at two different times with different umasks... but short of creating our own install command, it couldn't hurt to have spack stack create env spit out a warning for a "bad" umask.

@climbfuji
Copy link
Collaborator

That sounds good-- I can think of some cases that would make it worth doing both (weird build systems; network FS quirks on Acorn). The one limitation I can think of is that creating and installing the environment could theoretically be done at two different times with different umasks... but short of creating our own install command, it couldn't hurt to have spack stack create env spit out a warning for a "bad" umask.

I can take care of that part, thanks for the feedback.

Copy link
Collaborator

@climbfuji climbfuji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to add this step to the CI? We know that there should be no wrong permissions, but it would be good to run the script nonetheless?

@AlexanderRichert-NOAA
Copy link
Collaborator Author

Generally I think using this command will lead us to run chmod on our installations, as opposed to leading to "deep" changes to configs/recipes/codes. So for now I would say we don't need it in the CI, but we should revisit it if we run into issues that need a solution beyond just running chmod.

@climbfuji
Copy link
Collaborator

I would like to see the script being exercise = tested to not blow up, that's why I was asking. But it's ok as it is, too.

@AlexanderRichert-NOAA
Copy link
Collaborator Author

Ah I see what you mean. I think in a separate PR I'll add CI testing for utilities (including testing various cases for the duplicate checker).

@climbfuji climbfuji merged commit 847d9a6 into JCSDA:develop Jun 28, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants