-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kir Kolyshkin <[email protected]> (cherry picked from commit 7b30fd0) Signed-off-by: Sebastiaan van Stijn <[email protected]>
- Loading branch information
Showing
12 changed files
with
3,025 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,3 +150,9 @@ github.com/Nvveen/Gotty a8b993ba6abdb0e0c12b0125c603323a71c7790c https://github. | |
github.com/docker/go-metrics d466d4f6fd960e01820085bd7e1a24426ee7ef18 | ||
|
||
github.com/opencontainers/selinux b29023b86e4a69d1b46b7e7b4e2b6fda03f0b9cd | ||
|
||
|
||
# archive/tar (for Go 1.10, see https://github.com/golang/go/issues/24787) | ||
# mkdir -p ./vendor/archive | ||
# git clone -b go-1.10 --depth=1 [email protected]:kolyshkin/go-tar.git ./vendor/archive/tar | ||
# vndr # to clean up test files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Copyright (c) 2009 The Go Authors. All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following disclaimer | ||
in the documentation and/or other materials provided with the | ||
distribution. | ||
* Neither the name of Google Inc. nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
This is a fork of Go 1.10 `archive/tar` package from the official | ||
[repo](https://github.com/golang/go/tree/release-branch.go1.10/src/archive/tar), | ||
with a partial [revert](https://github.com/kolyshkin/go-tar/commit/d651d6e45972363e9bb62b8e9d876df440b31628) | ||
of upstream [commit 0564e304a6ea](https://github.com/golang/go/commit/0564e304a6ea394a42929060c588469dbd6f32af). | ||
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](https://golang.org/pkg/archive/tar/) from a static binary | ||
compiled with glibc on Linux can result in a panic upon calling | ||
[`tar.FileInfoHeader()`](https://golang.org/pkg/archive/tar/#FileInfoHeader). | ||
This is a major regression in Go 1.10, filed as | ||
[Go issue #24787](https://github.com/golang/go/issues/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](https://github.com/golang/go/issues/23265)) | ||
and already fixed by [Go commit 62f0127d81](https://github.com/golang/go/commit/62f0127d8104d8266d9a3fb5a87e2f09ec8b6f5b). | ||
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. |
Oops, something went wrong.