Skip to content

WIP: Fix permissions for newly created dirs in ADD#41990

Closed
cpuguy83 wants to merge 1 commit intomoby:masterfrom
cpuguy83:fix_unexpected_777_perm
Closed

WIP: Fix permissions for newly created dirs in ADD#41990
cpuguy83 wants to merge 1 commit intomoby:masterfrom
cpuguy83:fix_unexpected_777_perm

Conversation

@cpuguy83
Copy link
Copy Markdown
Member

@cpuguy83 cpuguy83 commented Feb 5, 2021

edb62a3 made it so permissions are set
for existing dirs, it also inadvertantly made it so Chmod is called
against (previously) non-existing dirs.
This had a side-effect that dir permissions are different than in
previous version of Docker when using ADD to add a tarball during
docker build (There may be other cases of this).

This makes it so we don't set perms for paths that we created as part of
MkdirAll since the perms should already be the ones we expect.


Related to #41978

I don't understand what's happening here.
Why is it different? Why does the dir created with prior to calling chmod have 0755 permissions even though the caller passed in 0777?

edb62a3 made it so permissions are set
for existing dirs, it also inadvertantly made it so `Chmod` is called
against (previously) non-existing dirs.
This had a side-effect that dir permissions are different than in
previous version of Docker when using `ADD` to add a tarball during
`docker build` (There may be other cases of this).

This makes it so we don't set perms for paths that we created as part of
`MkdirAll` since the perms should already be the ones we expect.

Signed-off-by: Brian Goff <[email protected]>
@tianon
Copy link
Copy Markdown
Member

tianon commented Feb 5, 2021

That sounds like a umask problem (especially since the default is typically 0022) 😕

Heh, same conclusion as in early comments on #41978 🤦

@cpuguy83
Copy link
Copy Markdown
Member Author

Per discussion, we should just change pkg/archive to set 0755 instead of 0777.
We don't want to rely on umask here because we don't want different results based on what host it is running on.

@cpuguy83
Copy link
Copy Markdown
Member Author

Replaced by #42016

@cpuguy83 cpuguy83 closed this Feb 17, 2021
@thaJeztah thaJeztah removed this from the 21.xx milestone Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants