• Joe Tsai's avatar
    archive/tar: make Reader handle GNU format properly · d2aa8601
    Joe Tsai authored
    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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    d2aa8601