1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #3868 from 1uptalent/3867-allow-pax-global-extended-headers-to-passthrough

FIX 3867 allow pax global extended headers to passthrough
This commit is contained in:
Guillaume J. Charmes 2014-01-31 17:54:08 -08:00
commit f9b4146ad4
2 changed files with 16 additions and 0 deletions

View file

@ -228,6 +228,10 @@ func createTarFile(path, extractDir string, hdr *tar.Header, reader *tar.Reader)
return err return err
} }
case tar.TypeXGlobalHeader:
utils.Debugf("PAX Global Extended Headers found and ignored")
return nil
default: default:
return fmt.Errorf("Unhandled tar header type %d\n", hdr.Typeflag) return fmt.Errorf("Unhandled tar header type %d\n", hdr.Typeflag)
} }

View file

@ -1,6 +1,7 @@
package archive package archive
import ( import (
"archive/tar"
"bytes" "bytes"
"fmt" "fmt"
"io" "io"
@ -124,3 +125,14 @@ func TestTarUntar(t *testing.T) {
} }
} }
} }
// Some tar archives such as http://haproxy.1wt.eu/download/1.5/src/devel/haproxy-1.5-dev21.tar.gz
// use PAX Global Extended Headers.
// Failing prevents the archives from being uncompressed during ADD
func TestTypeXGlobalHeaderDoesNotFail(t *testing.T) {
hdr := tar.Header{Typeflag: tar.TypeXGlobalHeader}
err := createTarFile("pax_global_header", "some_dir", &hdr, nil)
if err != nil {
t.Fatal(err)
}
}