containerd/archive
Maksym Pavlenko 0f51aa874d Add NoSameOwner option when unpacking tars
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 <pavlenko.maksym@gmail.com>
2022-09-09 17:07:26 -07:00
..
compression Drop deprecated ioutil 2022-07-23 08:36:20 -07:00
tartest Fix annotation typo error 2018-12-14 23:18:42 +08:00
issues_test.go Add NoSameOwner option when unpacking tars 2022-09-09 17:07:26 -07:00
link_default.go archive: use Linkat on FreeBSD for hardlinks 2022-06-09 18:54:09 -07:00
link_freebsd.go archive: use Linkat on FreeBSD for hardlinks 2022-06-09 18:54:09 -07:00
tar_freebsd.go Remove redundant build tags 2021-08-05 22:27:46 -07:00
tar_linux_test.go test: use T.TempDir to create temporary test directory 2022-03-15 14:03:50 +08:00
tar_mostunix.go Run go fmt with Go 1.17 2021-08-22 09:31:50 +09:00
tar_opts_linux.go Remove redundant build tags 2021-08-05 22:27:46 -07:00
tar_opts_windows.go docs: rename main to master 2021-08-10 09:42:16 -07:00
tar_opts.go Add NoSameOwner option when unpacking tars 2022-09-09 17:07:26 -07:00
tar_test.go archive: Explicitly specify stdio for tar(1) 2022-06-09 18:54:10 -07:00
tar_unix.go feat: replace github.com/pkg/errors to errors 2022-01-07 10:27:03 +08:00
tar_windows.go feat: replace github.com/pkg/errors to errors 2022-01-07 10:27:03 +08:00
tar.go Add NoSameOwner option when unpacking tars 2022-09-09 17:07:26 -07:00
time_unix.go feat: replace github.com/pkg/errors to errors 2022-01-07 10:27:03 +08:00
time_windows.go Licence header added 2018-02-19 10:32:26 +09:00
time.go Licence header added 2018-02-19 10:32:26 +09:00