aboutsummaryrefslogtreecommitdiffstats
path: root/vm/gce
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-06-17 18:30:12 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-06-17 18:30:12 +0200
commit98877a11dd1ab9e9570bfc7552140ccec8b9d326 (patch)
tree3efea195464191679cd9a9fdc0012b7d7f106575 /vm/gce
parent6611b23392e1c1231cb838ad75d5b3a0ce57c46c (diff)
vm/gce: fix image archive creation
See the added comment.
Diffstat (limited to 'vm/gce')
-rw-r--r--vm/gce/gce.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/vm/gce/gce.go b/vm/gce/gce.go
index 0ba38298e..81cd02f67 100644
--- a/vm/gce/gce.go
+++ b/vm/gce/gce.go
@@ -346,10 +346,14 @@ func uploadImageToGCS(localImage, gcsImage string) error {
Mode: 0640,
Size: localStat.Size(),
ModTime: time.Now(),
- Uid: 0,
- Uname: "root",
- Gid: 0,
- Gname: "",
+ // This is hacky but we actually need these large uids.
+ // GCE understands only the old GNU tar format and
+ // there is no direct way to force tar package to use GNU format.
+ // But these large numbers force tar to switch to GNU format.
+ Uid: 100000000,
+ Gid: 100000000,
+ Uname: "syzkaller",
+ Gname: "syzkaller",
}
if err := tarWriter.WriteHeader(tarHeader); err != nil {
return fmt.Errorf("failed to write image tar header: %v", err)