summaryrefslogtreecommitdiff
path: root/libpod/container_internal_linux.go
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2021-02-10 09:46:12 -0500
committerMatthew Heon <mheon@redhat.com>2021-02-10 14:21:37 -0500
commitea910fc53537d8c6f8cd1e1eaad49eaa5906c5f5 (patch)
treeeb8c9c48634c82617b83ac09b316c0ed57fc64e9 /libpod/container_internal_linux.go
parent763d522983b819ecd38689c9c0840069d1e2b530 (diff)
downloadpodman-ea910fc53537d8c6f8cd1e1eaad49eaa5906c5f5.tar.gz
podman-ea910fc53537d8c6f8cd1e1eaad49eaa5906c5f5.tar.bz2
podman-ea910fc53537d8c6f8cd1e1eaad49eaa5906c5f5.zip
Rewrite copy-up to use buildah Copier
The old copy-up implementation was very unhappy with symlinks, which could cause containers to fail to start for unclear reasons when a directory we wanted to copy-up contained one. Rewrite to use the Buildah Copier, which is more recent and should be both safer and less likely to blow up over links. At the same time, fix a deadlock in copy-up for volumes requiring mounting - the Mountpoint() function tried to take the already-acquired volume lock. Fixes #6003 Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod/container_internal_linux.go')
-rw-r--r--libpod/container_internal_linux.go17
1 files changed, 0 insertions, 17 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go
index 3583f8fdd..1c4537a27 100644
--- a/libpod/container_internal_linux.go
+++ b/libpod/container_internal_linux.go
@@ -2278,23 +2278,6 @@ func (c *Container) generatePasswdAndGroup() (string, string, error) {
return passwdPath, groupPath, nil
}
-func (c *Container) copyOwnerAndPerms(source, dest string) error {
- info, err := os.Stat(source)
- if err != nil {
- if os.IsNotExist(err) {
- return nil
- }
- return err
- }
- if err := os.Chmod(dest, info.Mode()); err != nil {
- return err
- }
- if err := os.Chown(dest, int(info.Sys().(*syscall.Stat_t).Uid), int(info.Sys().(*syscall.Stat_t).Gid)); err != nil {
- return err
- }
- return nil
-}
-
// Get cgroup path in a format suitable for the OCI spec
func (c *Container) getOCICgroupPath() (string, error) {
unified, err := cgroups.IsCgroup2UnifiedMode()