]> Cypherpunks repositories - gostls13.git/commit
archive/tar: Fix support for long links and improve PAX support.
authorMarco Hennings <marco.hennings@freiheit.com>
Mon, 19 Aug 2013 00:45:44 +0000 (10:45 +1000)
committerDavid Symonds <dsymonds@golang.org>
Mon, 19 Aug 2013 00:45:44 +0000 (10:45 +1000)
commita07c95a53c906e2d30762d76cd3e36c93d2c83f4
tree4ae31e3ad027efb2b3f0c9583087c4dca8ecc7cb
parent1ad6fc6bc46e874f3c866825afcde2cec7d50981
archive/tar: Fix support for long links and improve PAX support.

The tar/archive code from golang has a problem with linknames with length >
100. A pax header is added but the original header still written with a too
long field length.

As it is clear that pax support is incomplete I have added missing
implementation parts.

This commit contains code from the golang project in the folder tar/archiv.

The following pax header records are now automatically written:

- gname)
- linkpath
- path
- uname

The following fields can be written with PAX, but the default is to use the
star binary extension.

- gid  (value > 2097151)
- size (value > 8589934591)
- uid (value > 2097151)

The string fields are written when the value is longer as the field or if the
string contains a char that is not encodable as 7-bit ASCII value.

The change was tested against a current ubuntu-cloud image tarball comparing
the compressed result.

+ added some automated tests for the new functionality.

Fixes #6056.

R=dsymonds
CC=golang-dev
https://golang.org/cl/12561043
src/pkg/archive/tar/common.go
src/pkg/archive/tar/reader.go
src/pkg/archive/tar/writer.go
src/pkg/archive/tar/writer_test.go