diff --git a/pis/update.go b/pis/update.go index c3544fb..ee64df5 100644 --- a/pis/update.go +++ b/pis/update.go @@ -98,7 +98,6 @@ func extractFiles(gzipStream io.Reader, dest string) error { if err != nil { return err } - defer uncompressedStream.Close() tarReader := tar.NewReader(uncompressedStream) @@ -112,6 +111,12 @@ func extractFiles(gzipStream io.Reader, dest string) error { return err } + // Handle pax_global_header or other unsupported types + if header.Typeflag == tar.TypeXGlobalHeader || header.Name == "pax_global_header" { + // Skip this special header file + continue + } + filePath := filepath.Join(dest, header.Name) switch header.Typeflag { @@ -124,7 +129,6 @@ func extractFiles(gzipStream io.Reader, dest string) error { if err != nil { return err } - if _, err := io.Copy(outFile, tarReader); err != nil { return err }