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

overlay: set permissions on "diff" correctly #772

Merged
merged 1 commit into from Nov 13, 2020

Conversation

nalind
Copy link
Member

@nalind nalind commented Nov 12, 2020

When creating a new layer that has a parent, assign the new layer's "diff" directory the same permissions as the parent layer's "diff" directory, rather than the permissions of the parent of its parent layer's "diff" directory.

Before the recent round of changes, that directory would be initialized with 0700 permissions, so layers created by new code on top of layers created by the older version would be marked 0700, and were not usable by UIDs other than 0.

Spotted in CI tests for buildah that try to use overlay to create containers on top of base images that were imported using a slightly older version of podman, for example https://cirrus-ci.com/task/6024517489262592.

@rhatdan
Copy link
Member

rhatdan commented Nov 13, 2020

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -631,6 +626,18 @@ func (d *Driver) create(id, parent string, opts *graphdriver.CreateOpts) (retErr
}
}

perms := defaultPerms
if d.options.forceMask != nil {
Copy link
Member

Choose a reason for hiding this comment

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

I think this should have precedence and override the parent mode

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, yeah, you're right. Changing it.

When creating a new layer that has a parent, assign the new layer's
"diff" directory the same permissions as the parent layer's "diff"
directory, rather than the permissions of the parent of its parent
layer's "diff" directory.

Before the recent round of changes, that directory would be initialized
with 0700 permissions, so layers created by new code on top of layers
created by the older version would be given 0700 permissions, and were
not usable by UIDs other than 0.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
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.

None yet

5 participants