]> Cypherpunks repositories - gostls13.git/commit
archive/tar: make Reader handle GNU format properly
authorJoe Tsai <joetsai@digital-static.net>
Wed, 19 Oct 2016 00:51:04 +0000 (17:51 -0700)
committerJoe Tsai <thebrokentoaster@gmail.com>
Wed, 19 Oct 2016 18:07:55 +0000 (18:07 +0000)
commitd2aa8601b5aafa9736f8e49ca713ecc31f9a011f
treee4fce93a98d731d377c6856ce07bed668a1947fb
parent40d81cf061d8a2a277d70446f582a984c1701ff3
archive/tar: make Reader handle GNU format properly

The GNU format does not have a prefix field, so we should make
no attempt to read it. It does however have atime and ctime fields.
Since Go previously placed incorrect values here, we liberally
read the atime and ctime fields and ignore errors so that old tar
files written by Go can at least be partially read.

This fixes half of #12594. The Writer is much harder to fix.

Updates #12594

Change-Id: Ia32845e2f262ee53366cf41dfa935f4d770c7a30
Reviewed-on: https://go-review.googlesource.com/31444
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/archive/tar/reader.go
src/archive/tar/reader_test.go
src/archive/tar/testdata/gnu-incremental.tar [new file with mode: 0644]