campaigns: widen permissions on mounted paths#366
Merged
Conversation
This fixes #365 by ensuring that files and workspaces mounted into campaign containers are world readable, writable, and executable as appropriate.
eseliger
approved these changes
Nov 4, 2020
| // that the file is globally writable. If the execute bit is normally | ||
| // set on the zipped up file, let's ensure we propagate that to the | ||
| // group and other permission bits too. | ||
| if f.Mode()&0111 != 0 { |
|
|
||
| // This file needs to be readable within the container regardless of | ||
| // the user the container is running as. | ||
| if err := runScriptFile.Chmod(0644); err != nil { |
Member
There was a problem hiding this comment.
does it not need to be executable?
Contributor
Author
There was a problem hiding this comment.
Counter intuitively, no! The Docker command basically boils down to this:
docker run --entrypoint /bin/bash -- sha256:CONTAINER_ID /tmp/some-horrible-script-nameSince the shell is the entrypoint, only that needs to be executable, and the script being run is just a regular old command line parameter.
Contributor
Author
|
OK, it looks like we have some Windows issues, so please hold while I figure out how much they matter. (My suspicion is: not much, given the different Docker execution model on Windows.) |
chrispine
approved these changes
Nov 4, 2020
chrispine
left a comment
There was a problem hiding this comment.
Thanks for getting to this so quickly!
eseliger
reviewed
Nov 4, 2020
|
|
||
| have := mustGetPerm(t, path) | ||
|
|
||
| // Go maps Windows file attributes onto Unix permissions in a fairly trivial |
mrnugget
approved these changes
Nov 5, 2020
Contributor
|
Good stuff! |
scjohns
pushed a commit
that referenced
this pull request
Apr 24, 2023
This fixes #365 by ensuring that files and workspaces mounted into campaign containers are world readable, writable, and executable as appropriate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes #365 by ensuring that files and workspaces mounted into campaign containers are world readable, writable, and executable as appropriate.