1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/pkg/archive
Tonis Tiigi 4a3cfda45e archive: add test for prefix header
With docker-17.06.0 some images pulled do not extract properly. Some files don't appear in correct directories. This may or may not cause the pull to fail. These images can't be pushed or saved. 17.06 is the first version of Docker built with go1.8.

Cause

There are multiple updates to the tar package in go1.8.

https://go-review.googlesource.com/c/32234/ disables using "prefix" field when new tar archives are being written. Prefix field was previously set when a record in the archive used a path longer than 100 bytes.

Another change https://go-review.googlesource.com/c/31444/ makes the reader ignore the "prefix" field value if the record is in GNU format. GNU format defines that same area should be used for access and modified times. If the "prefix" field is not read, a file will only be extracted by the basename.

The problem is that with a previous version of the golang archive package headers could be written, that use the prefix field while at the same time setting the header format to GNU. This happens when numeric fields are big enough that they can not be written as octal strings and need to be written in binary. Usually, this shouldn't happen: uid, gid, devmajor, devminor can use up to 7 bytes, size and timestamp can use 11. If one of the records does overflow it switches the whole writer to GNU mode and all next files will be saved in GNU format.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-07-14 10:20:48 -07:00
..
testdata Move archive package into pkg/archive 2014-09-29 23:23:36 -07:00
archive.go Merge pull request #33935 from AkihiroSuda/pkg-archive-go1.9 2017-07-06 14:22:45 -07:00
archive_linux.go [project] change syscall to /x/sys/unix|windows 2017-07-11 08:00:32 -04:00
archive_linux_test.go [project] change syscall to /x/sys/unix|windows 2017-07-11 08:00:32 -04:00
archive_other.go Update archive package to support overlay whiteouts 2016-06-08 00:10:16 -07:00
archive_test.go archive: add test for prefix header 2017-07-14 10:20:48 -07:00
archive_unix.go [project] change syscall to /x/sys/unix|windows 2017-07-11 08:00:32 -04:00
archive_unix_test.go [project] change syscall to /x/sys/unix|windows 2017-07-11 08:00:32 -04:00
archive_windows.go Remove ToHost and replace it with IDMappings.ToHost 2017-06-07 11:44:34 -04:00
archive_windows_test.go Remove unused functions from archive. 2017-06-07 11:44:33 -04:00
changes.go Convert tarAppender to the newIDMappings. 2017-06-07 11:44:34 -04:00
changes_linux.go [project] change syscall to /x/sys/unix|windows 2017-07-11 08:00:32 -04:00
changes_other.go Windows: Docker build starting to work 2015-06-17 10:41:28 -07:00
changes_posix_test.go Add functional support for Docker sub commands on Solaris 2016-11-07 09:06:34 -08:00
changes_test.go Spelling fixes 2017-07-03 13:13:09 -07:00
changes_unix.go [project] change syscall to /x/sys/unix|windows 2017-07-11 08:00:32 -04:00
changes_windows.go Tidy pkg\system *stat* functions 2017-04-05 16:01:53 -07:00
copy.go Fix docker cp dir with hard link 2017-07-06 17:03:38 +08:00
copy_unix.go Windows - make docker cp functional 2015-08-06 11:22:38 -07:00
copy_unix_test.go fix typo 2017-01-19 15:52:28 +08:00
copy_windows.go Windows - make docker cp functional 2015-08-06 11:22:38 -07:00
diff.go LCOW: Create layer folders with correct ACL 2017-06-20 19:50:12 -07:00
diff_test.go Windows CI: test-unit on pkg\archive part 2 2016-02-12 15:40:41 -08:00
example_changes.go archive: example app for diffing directories 2014-10-29 14:52:59 -04:00
README.md Move archive package into pkg/archive 2014-09-29 23:23:36 -07:00
time_linux.go Move archive package into pkg/archive 2014-09-29 23:23:36 -07:00
time_unsupported.go Move archive package into pkg/archive 2014-09-29 23:23:36 -07:00
utils_test.go pkg/archive: remove unnecessary Archive and Reader type 2016-10-20 19:31:24 -07:00
whiteouts.go Fix typos found across repository 2015-12-13 18:04:12 +02:00
wrap.go pkg/archive: remove unnecessary Archive and Reader type 2016-10-20 19:31:24 -07:00
wrap_test.go Add coverage on pkg/archive 2015-04-24 17:03:33 +02:00

This code provides helper functions for dealing with archive files.