summaryrefslogtreecommitdiff
path: root/pkg/domain
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-11-30 10:44:21 +0100
committerGitHub <noreply@github.com>2021-11-30 10:44:21 +0100
commit8de68b170716dd1293c5a044f3e9cfd962fdbfb1 (patch)
tree15b259ba342f3179c8efd1c6eec385459c2a2d0d /pkg/domain
parentd51ebca0c17cb69d2e5dfa45a5e2392e0afbd05e (diff)
parent931c08157e6032837f1a1b52a822e9e276b72e91 (diff)
downloadpodman-8de68b170716dd1293c5a044f3e9cfd962fdbfb1.tar.gz
podman-8de68b170716dd1293c5a044f3e9cfd962fdbfb1.tar.bz2
podman-8de68b170716dd1293c5a044f3e9cfd962fdbfb1.zip
Merge pull request #12408 from rhatdan/stdout
Only open save output file with WRONLY
Diffstat (limited to 'pkg/domain')
-rw-r--r--pkg/domain/infra/tunnel/images.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/domain/infra/tunnel/images.go b/pkg/domain/infra/tunnel/images.go
index fde57972f..2feb9d7ad 100644
--- a/pkg/domain/infra/tunnel/images.go
+++ b/pkg/domain/infra/tunnel/images.go
@@ -270,7 +270,10 @@ func (ir *ImageEngine) Save(ctx context.Context, nameOrID string, tags []string,
defer func() { _ = os.Remove(f.Name()) }()
}
default:
- f, err = os.Create(opts.Output)
+ // This code was added to allow for opening stdout replacing
+ // os.Create(opts.Output) which was attempting to open the file
+ // for read/write which fails on Darwin platforms
+ f, err = os.OpenFile(opts.Output, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0644)
}
if err != nil {
return err