• Caio Marcelo de Oliveira Filho's avatar
    archive/tar: automatically promote TypeRegA · e4bde051
    Caio Marcelo de Oliveira Filho authored
    Change Reader to promote TypeRegA to TypeReg in headers, unless their
    name have a trailing slash which is already promoted to TypeDir. This
    will allow client code to handle just TypeReg instead both TypeReg and
    TypeRegA.
    
    Change Writer to promote TypeRegA to TypeReg or TypeDir in the headers
    depending on whether the name has a trailing slash. This normalization
    is motivated by the specification (in pax(1)):
    
       0 represents a regular file. For backwards-compatibility, a
       typeflag value of binary zero ( '\0' ) should be recognized as
       meaning a regular file when extracting files from the
       archive. Archives written with this version of the archive file
       format create regular files with a typeflag value of the
       ISO/IEC 646:1991 standard IRV '0'.
    
    Fixes #22768.
    
    Change-Id: I149ec55824580d446cdde5a0d7a0457ad7b03466
    Reviewed-on: https://go-review.googlesource.com/85656Reviewed-by: 's avatarJoe Tsai <thebrokentoaster@gmail.com>
    Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    e4bde051
Name
Last commit
Last update
..
file-and-dir.tar Loading commit data...
gnu-incremental.tar Loading commit data...
gnu-long-nul.tar Loading commit data...
gnu-multi-hdrs.tar Loading commit data...
gnu-nil-sparse-data.tar Loading commit data...
gnu-nil-sparse-hole.tar Loading commit data...
gnu-not-utf8.tar Loading commit data...
gnu-sparse-big.tar Loading commit data...
gnu-utf8.tar Loading commit data...
gnu.tar Loading commit data...
hardlink.tar Loading commit data...
hdr-only.tar Loading commit data...
invalid-go17.tar Loading commit data...
issue10968.tar Loading commit data...
issue11169.tar Loading commit data...
issue12435.tar Loading commit data...
neg-size.tar Loading commit data...
nil-uid.tar Loading commit data...
pax-bad-hdr-file.tar Loading commit data...
pax-bad-mtime-file.tar Loading commit data...
pax-global-records.tar Loading commit data...
pax-multi-hdrs.tar Loading commit data...
pax-nil-sparse-data.tar Loading commit data...
pax-nil-sparse-hole.tar Loading commit data...
pax-nul-path.tar Loading commit data...
pax-nul-xattrs.tar Loading commit data...
pax-path-hdr.tar Loading commit data...
pax-pos-size-file.tar Loading commit data...
pax-records.tar Loading commit data...
pax-sparse-big.tar Loading commit data...
pax.tar Loading commit data...
small.txt Loading commit data...
small2.txt Loading commit data...
sparse-formats.tar Loading commit data...
star.tar Loading commit data...
trailing-slash.tar Loading commit data...
ustar-file-devs.tar Loading commit data...
ustar-file-reg.tar Loading commit data...
ustar.tar Loading commit data...
v7.tar Loading commit data...
writer-big-long.tar Loading commit data...
writer-big.tar Loading commit data...
writer.tar Loading commit data...
xattrs.tar Loading commit data...