moby/vendor/archive/tar
Kir Kolyshkin 66720189e0
archive/tar: vendor again
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 7b30fd0e1d8bc77f0556181c82f85d046b058f27)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-04-12 13:36:58 -07:00
..
common.go archive/tar: vendor again 2018-04-12 13:36:58 -07:00
format.go archive/tar: vendor again 2018-04-12 13:36:58 -07:00
LICENSE archive/tar: vendor again 2018-04-12 13:36:58 -07:00
reader.go archive/tar: vendor again 2018-04-12 13:36:58 -07:00
README.md archive/tar: vendor again 2018-04-12 13:36:58 -07:00
stat_actime1.go archive/tar: vendor again 2018-04-12 13:36:58 -07:00
stat_actime2.go archive/tar: vendor again 2018-04-12 13:36:58 -07:00
stat_unix.go archive/tar: vendor again 2018-04-12 13:36:58 -07:00
strconv.go archive/tar: vendor again 2018-04-12 13:36:58 -07:00
writer.go archive/tar: vendor again 2018-04-12 13:36:58 -07:00

This is a fork of Go 1.10 archive/tar package from the official repo, with a partial revert of upstream commit 0564e304a6ea. It is suggested as a replacement to the original package included with Go 1.10 in case you want to build a static Linux/glibc binary that works, and can't afford to use CGO_ENABLED=0.

Details

Using Go 1.10 archive/tar from a static binary compiled with glibc on Linux can result in a panic upon calling tar.FileInfoHeader(). This is a major regression in Go 1.10, filed as Go issue #24787.

The above issue is caused by an unfortunate combination of:

  1. glibc way of dynamic loading of nss libraries even for a static build;
  2. Go os/user package hard-coded reliance on libc to resolve user/group IDs to names (unless CGO is disabled).

While glibc can probably not be fixed and is not considered a bug per se, the os/user issue is documented (see Go issue #23265) and already fixed by Go commit 62f0127d81. The fix is expected to make its way to Go 1.11, and requires osusergo build tag to be used for a static build.

This repository serves as a temporary workaround until the above fix is available.