Skip to content

Conversation

@mxpv
Copy link
Member

@mxpv mxpv commented Sep 10, 2022

When unpacking a TAR archive, containerd preserves file's owner: https://github.com/containerd/containerd/blob/main/archive/tar.go#L384

In some cases this behavior is not desired. In current implementation we avoid Lchown on Windows. Another case when this should be skipped is when using native snapshotter on darwin and running as non-root user.

This PR extracts a generic option - WithNoSameOwner (same as tar --no-same-owner) to skip Lchown when its not required.

Signed-off-by: Maksym Pavlenko [email protected]

When unpacking a TAR archive, containerd preserves file's owner:
https://github.com/containerd/containerd/blob/main/archive/tar.go#L384

In some cases this behavior is not desired. In current implementation we
avoid `Lchown` on Windows. Another case when this should be skipped is
when using native snapshotter on darwin and running as non-root user.

This PR extracts a generic option - `WithNoSameOwner` (same as
`tar --no-same-owner`) to skip `Lchown` when its not required.

Signed-off-by: Maksym Pavlenko <[email protected]>
@samuelkarp samuelkarp merged commit f4095a6 into containerd:main Sep 10, 2022
@mxpv mxpv deleted the no-same-owner branch September 10, 2022 16:10
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/platforms"
"github.com/containerd/containerd/plugin"
digest "github.com/opencontainers/go-digest"
Copy link
Member

Choose a reason for hiding this comment

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

?

"time"

winio "github.com/Microsoft/go-winio"
"github.com/Microsoft/go-winio"
Copy link
Member

Choose a reason for hiding this comment

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

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants