Skip to content

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

Merged
kolyshkin merged 2 commits intoopencontainers:release-1.1from
lifubang:backport-ModeStricky
Aug 3, 2023
Merged

[1.1] Fix some file mode bits missing when doing mount syscall#3961
kolyshkin merged 2 commits intoopencontainers:release-1.1from
lifubang:backport-ModeStricky

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 PR to release-1.1 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
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>
@lifubang lifubang deleted the backport-ModeStricky branch October 15, 2024 05:50
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 PR to release-1.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants