summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorAleksey Chudov <aleksey.chudov@gmail.com>2019-10-30 18:52:04 +0200
committerAleksey Chudov <aleksey.chudov@gmail.com>2019-10-30 19:03:47 +0200
commit43c2c639541b6aa60134e81b3ab17ded7e3f01c1 (patch)
tree5fcf5d6931dfc4ae8d7d1d3e1e3c84c3f7281b4d /cmd
parenta35d002b722c9beb711796de4a62faf30d067387 (diff)
downloadpodman-43c2c639541b6aa60134e81b3ab17ded7e3f01c1.tar.gz
podman-43c2c639541b6aa60134e81b3ab17ded7e3f01c1.tar.bz2
podman-43c2c639541b6aa60134e81b3ab17ded7e3f01c1.zip
Fix cp from pipe
Signed-off-by: Aleksey Chudov <aleksey.chudov@gmail.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/cp.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/cmd/podman/cp.go b/cmd/podman/cp.go
index 75a23afd6..c53a97df3 100644
--- a/cmd/podman/cp.go
+++ b/cmd/podman/cp.go
@@ -257,8 +257,15 @@ func parsePath(runtime *libpod.Runtime, path string) (*libpod.Container, string)
return nil, path
}
+func evalSymlinks(path string) (string, error) {
+ if path == os.Stdin.Name() {
+ return path, nil
+ }
+ return filepath.EvalSymlinks(path)
+}
+
func getPathInfo(path string) (string, os.FileInfo, error) {
- path, err := filepath.EvalSymlinks(path)
+ path, err := evalSymlinks(path)
if err != nil {
return "", nil, errors.Wrapf(err, "error evaluating symlinks %q", path)
}
@@ -270,7 +277,7 @@ func getPathInfo(path string) (string, os.FileInfo, error) {
}
func copy(src, destPath, dest string, idMappingOpts storage.IDMappingOptions, chownOpts *idtools.IDPair, extract, isFromHostToCtr bool) error {
- srcPath, err := filepath.EvalSymlinks(src)
+ srcPath, err := evalSymlinks(src)
if err != nil {
return errors.Wrapf(err, "error evaluating symlinks %q", srcPath)
}