diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-09-08 09:49:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-08 09:49:22 +0200 |
commit | 598d914e625616da49df7c068ffd84135d12571e (patch) | |
tree | 87a465d838ae70e0a36fdefd664b5f5dba2f0327 /pkg | |
parent | 536f23c0b78dd8feafee4e40b743988dbb03bfa2 (diff) | |
parent | 748c2700b4d839a43be6061ad3bedc3e2f08ab3a (diff) | |
download | podman-598d914e625616da49df7c068ffd84135d12571e.tar.gz podman-598d914e625616da49df7c068ffd84135d12571e.tar.bz2 podman-598d914e625616da49df7c068ffd84135d12571e.zip |
Merge pull request #11473 from nalind/build-context-as-root
pkg/bindings/images.nTar(): set ownership of build context to 0:0
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/bindings/images/build.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/bindings/images/build.go b/pkg/bindings/images/build.go index 39e0fc5df..3beafa585 100644 --- a/pkg/bindings/images/build.go +++ b/pkg/bindings/images/build.go @@ -501,6 +501,7 @@ func nTar(excludes []string, sources ...string) (io.ReadCloser, error) { if err != nil { return err } + hdr.Uid, hdr.Gid = 0, 0 orig, ok := seen[di] if ok { hdr.Typeflag = tar.TypeLink @@ -532,6 +533,7 @@ func nTar(excludes []string, sources ...string) (io.ReadCloser, error) { return lerr } hdr.Name = name + hdr.Uid, hdr.Gid = 0, 0 if lerr := tw.WriteHeader(hdr); lerr != nil { return lerr } @@ -545,6 +547,7 @@ func nTar(excludes []string, sources ...string) (io.ReadCloser, error) { return lerr } hdr.Name = name + hdr.Uid, hdr.Gid = 0, 0 if lerr := tw.WriteHeader(hdr); lerr != nil { return lerr } |