]> Cypherpunks repositories - gostls13.git/commit
archive/tar: disable prefix field in Writer
authorJoe Tsai <joetsai@digital-static.net>
Thu, 27 Oct 2016 23:23:53 +0000 (16:23 -0700)
committerJoe Tsai <thebrokentoaster@gmail.com>
Wed, 2 Nov 2016 20:18:38 +0000 (20:18 +0000)
commit2d3cd51dbe5b5266b9baf68fb42ea19fedf4d23e
tree1d9a5fd1fea8ea272ba959078cf74bc957e23b53
parenteed2bb71d235e2c8b6d6eae57af83fbff23d420e
archive/tar: disable prefix field in Writer

The proper fix for the Writer is too involved to be done in time
for Go 1.8. Instead, we do a localized fix that simply disables the
prefix encoding logic. While this will prevent some legitimate uses
of prefix, it will ensure that we don't keep outputting invalid
GNU format files that have the prefix field populated.

For headers with long filenames that could have used the prefix field,
they will be promoted to use the PAX format, which ensures that we
will still be able to encode all headers that we were able to do before.

Updates #12594
Fixes #17630
Fixes #9683

Change-Id: Ia97b524ac69865390e2ae8bb0dfb664d40a05add
Reviewed-on: https://go-review.googlesource.com/32234
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/archive/tar/testdata/ustar.issue12594.tar [new file with mode: 0644]
src/archive/tar/testdata/writer-big-long.tar
src/archive/tar/writer.go
src/archive/tar/writer_test.go