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

Invoke chmod once per directory to fix permissions #420

Merged

Conversation

christopher-hopper
Copy link
Contributor

Change proposed

I noticed that fix-permissions was traversing the file system twice to set the file mode bits on directories. We can set all file mode bits for both directories and files at the same time.

We could select file mode letter capital X - see chmod man page

(X) : execute (or search for directories) only if the file is a directory or already has execute permission for some user

This doesn't change build speed by much but I thought I'd share it anyway. It simplifies the permissions change using a common, long supported method.

@tobybellwood
Copy link
Member

Thanks @christopher-hopper - just trying to untangle some downstream issues - whilst this pr makes 100% sense, it also removes an inadvertent loophole - the final line of the old script will usually exit 0, even if the previous two fail, and thus pass that fix-permissions stage in a dockerfile 😢, whereas this version isn't as forgiving!

Obviously the error here is in whatever dockerfile thinks it is fixing-permissions and isn't, but we just need to work out where those are!

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