summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorQi Wang <qiwan@redhat.com>2020-01-02 00:52:51 -0500
committerQi Wang <qiwan@redhat.com>2020-01-02 00:53:02 -0500
commitb6e1689ff23777b91fdfe72823a9a4e10360c6c0 (patch)
tree3fd42ddf9ac9f05a179743b3f3e3cde9dcb12968 /cmd/podman
parent6a370cbbc7da9b7232bafed5e1afbe05ae88bcad (diff)
downloadpodman-b6e1689ff23777b91fdfe72823a9a4e10360c6c0.tar.gz
podman-b6e1689ff23777b91fdfe72823a9a4e10360c6c0.tar.bz2
podman-b6e1689ff23777b91fdfe72823a9a4e10360c6c0.zip
fix bug copy from container directory
Keep the original input source path with "/." so podman can copy the content of the directory when copying from container to host. Signed-off-by: Qi Wang <qiwan@redhat.com>
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/cp.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/podman/cp.go b/cmd/podman/cp.go
index 762d70252..1e4491f33 100644
--- a/cmd/podman/cp.go
+++ b/cmd/podman/cp.go
@@ -222,7 +222,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 +276,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)
}