-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
archive/tar: mode header field contains incorrect bits #20150
Comments
I looked through the history of I looked at GNU's implementation of tar and they do not have any bit modes defined larger than 07777. I believe there is sufficient evidence to remove setting these high bits when using FileInfoHeader. However, I believe the Reader and Writer should continue handling higher-order bits if a user specifically sets them. Just wondering, how were the setting of these high-order bits affecting your use-case? |
I discovered the problem while investigating a problem related to this issue in docker.py I found out that the root cause was that these mode bit was set. When docker compares files from different tar archives, in order to determine if a cache version can be used, it uses all the bits. Of course this issue can be fixed by changing the docker implementation, but I think the best solution is to fix it in archive/tar. |
CL https://golang.org/cl/42093 mentions this issue. |
To ensure that the cache from docker command client can be reused, we must clear group/user name as the docker client does. Together with golang/go#20150 this fixes docker#998
To ensure that the cache from docker command client can be reused, we must clear group/user name as the docker client does. Together with golang/go#20150 this fixes docker#998 Signed-off-by: Lars Jeppesen <[email protected]>
To ensure that the cache from docker command client can be reused, we must clear group/user name as the docker client does. Together with golang/go#20150 this fixes docker#998 Signed-off-by: Lars Jeppesen <[email protected]>
When using the FileInfoHeader to create a tar file header the mode field contains incorrect bits.
According to the GNU tar spec:
https://www.gnu.org/software/tar/manual/html_node/Standard.html
and POSIX:
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/tar.h.html
The mode field should only contain the permission bits (bit 0-11)
But the FileInfoHeader also set bit 15 for regular files and bit 14 for directories.
And properly also other bits for other types of files.
What version of Go are you using (
go version
)?go version go1.8.1 linux/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/lje/work/golang"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build824361864=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
The text was updated successfully, but these errors were encountered: