Skip to content

Commit 1c4984e

Browse files
committed
Fix UID and GID permission issue with Local Source Build
Fixes #338 Changes: - Explicitly set UID and GID to 0 in "tar" header while writing archive, to prevent permission issue with local file having different UID and GID Signed-off-by: Sayan Biswas <sayan-biswas@live.com>
1 parent 66d990a commit 1c4984e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/shp/streamer/util.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ func writeFileToTar(tw *tar.Writer, src, fpath string, stat fs.FileInfo) error {
2828
}
2929

3030
header.Name = trimPrefix(src, fpath)
31+
32+
// Add explicit UID and GID
33+
header.Uid = 0
34+
header.Gid = 0
35+
3136
if err := tw.WriteHeader(header); err != nil {
3237
return err
3338
}

0 commit comments

Comments
 (0)