github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/vm/gce/tar_go1.9.go (about)

     1  // Copyright 2018 syzkaller project authors. All rights reserved.
     2  // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  //go:build !go1.10
     5  
     6  package gce
     7  
     8  import (
     9  	"archive/tar"
    10  )
    11  
    12  func setGNUFormat(hdr *tar.Header) {
    13  	// This is hacky but we actually need these large uids.
    14  	// GCE understands only the old GNU tar format and prior to Go 1.10
    15  	// there is no direct way to force tar package to use GNU format.
    16  	// But these large numbers force tar to switch to GNU format.
    17  	hdr.Uid = 100000000
    18  	hdr.Gid = 100000000
    19  }