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

[1.1] Fix some file mode bits missing when doing mount syscall #3961

Merged
merged 2 commits into from
Aug 3, 2023

Conversation

lifubang
Copy link
Member

@lifubang lifubang commented Aug 3, 2023

This the backport of #3956 to release-1.1, the original description is:


Fix #3952

When we call unix.Mount, if we use file mode bits from the bits with the type fs.FileMode directly, it will cause some bits missing.

Please refer: https://github.com/golang/go/blob/master/src/os/file.go#L258-L265


More details: https://www.gnu.org/software/coreutils/manual/html_node/Mode-Structure.html

Signed-off-by: lifubang <lifubang@acmcoder.com>
(cherry picked from commit 6092a4b)
Signed-off-by: lifubang <lifubang@acmcoder.com>
(cherry picked from commit 83137c6)
Signed-off-by: lifubang <lifubang@acmcoder.com>
Copy link
Member

@cyphar cyphar left a comment

Choose a reason for hiding this comment

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

LGTM

@lifubang lifubang added the backport/1.1-pr A backport to 1.1.x release. label Aug 3, 2023
@kolyshkin kolyshkin added this to the 1.1.9 milestone Aug 3, 2023
Copy link
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

LGTM

@kolyshkin kolyshkin merged commit aa68c40 into opencontainers:release-1.1 Aug 3, 2023
29 checks passed
kolyshkin referenced this pull request Aug 10, 2023
When a directory already exists (or after a container is restarted) the
perms of the directory being mounted to were being used even when a
different permission is set on the tmpfs mount options.

This prepends the original directory perms to the mount options.
If the perms were already set in the mount opts then those perms will
win.
This eliminates the need to perform a chmod after mount entirely.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.1-pr A backport to 1.1.x release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants