diff options
Diffstat (limited to 'cmd/podman/cp.go')
-rw-r--r-- | cmd/podman/cp.go | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/cmd/podman/cp.go b/cmd/podman/cp.go index 762d70252..ea97752a3 100644 --- a/cmd/podman/cp.go +++ b/cmd/podman/cp.go @@ -101,18 +101,7 @@ func copyBetweenHostAndContainer(runtime *libpod.Runtime, src string, dest strin } }() - // We can't pause rootless containers. - if pause && rootless.IsRootless() { - state, err := ctr.State() - if err != nil { - return err - } - if state == define.ContainerStateRunning { - return errors.Errorf("cannot copy into running rootless container with pause set - pass --pause=false to force copying") - } - } - - if pause && !rootless.IsRootless() { + if pause { if err := ctr.Pause(); err != nil { // An invalid state error is fine. // The container isn't running or is already paused. @@ -222,7 +211,7 @@ func copyBetweenHostAndContainer(runtime *libpod.Runtime, src string, dest strin srcPath = os.Stdin.Name() extract = true } - return copy(srcPath, destPath, dest, idMappingOpts, &destOwner, extract, isFromHostToCtr) + return copy(srcPath, destPath, src, dest, idMappingOpts, &destOwner, extract, isFromHostToCtr) } func getUser(mountPoint string, userspec string) (specs.User, error) { @@ -276,8 +265,8 @@ func getPathInfo(path string) (string, os.FileInfo, error) { return path, srcfi, nil } -func copy(src, destPath, dest string, idMappingOpts storage.IDMappingOptions, chownOpts *idtools.IDPair, extract, isFromHostToCtr bool) error { - srcPath, err := evalSymlinks(src) +func copy(srcPath, destPath, src, dest string, idMappingOpts storage.IDMappingOptions, chownOpts *idtools.IDPair, extract, isFromHostToCtr bool) error { + srcPath, err := evalSymlinks(srcPath) if err != nil { return errors.Wrapf(err, "error evaluating symlinks %q", srcPath) } |