pkg/archive
Josh Hawn bd8af5b419 Fix docker cp Behavior With Symlinks
[pkg/archive] Update archive/copy path handling

  - Remove unused TarOptions.Name field.
  - Add new TarOptions.RebaseNames field.
  - Update some of the logic around path dir/base splitting.
  - Update some of the logic behind archive entry name rebasing.

[api/types] Add LinkTarget field to PathStat

[daemon] Fix stat, archive, extract of symlinks

  These operations *should* resolve symlinks that are in the path but if the
  resource itself is a symlink then it *should not* be resolved. This patch
  puts this logic into a common function `resolvePath` which resolves symlinks
  of the path's dir in scope of the container rootfs but does not resolve the
  final element of the path. Now archive, extract, and stat operations will
  return symlinks if the path is indeed a symlink.

[api/client] Update cp path hanling

[docs/reference/api] Update description of stat

  Add the linkTarget field to the header of the archive endpoint.
  Remove path field.

[integration-cli] Fix/Add cp symlink test cases

  Copying a symlink should do just that: copy the symlink NOT
  copy the target of the symlink. Also, the resulting file from
  the copy should have the name of the symlink NOT the name of
  the target file.

  Copying to a symlink should copy to the symlink target and not
  modify the symlink itself.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-07-30 12:14:28 -07:00
..
testdata Move archive package into pkg/archive 2014-09-29 23:23:36 -07:00
archive.go Fix docker cp Behavior With Symlinks 2015-07-30 12:14:28 -07:00
archive_test.go Fix docker cp Behavior With Symlinks 2015-07-30 12:14:28 -07:00
archive_unix.go linting changes 2015-06-17 01:16:57 +03:00
archive_unix_test.go pkg/archive: adjust chmod bits on windows 2015-03-04 14:10:37 -08:00
archive_windows.go Windows: Archive package changes for Windows daemon 2015-05-20 08:55:54 -07:00
archive_windows_test.go trivial: typo cleanup 2015-04-27 13:35:08 -07:00
changes.go Windows: Docker build starting to work 2015-06-17 10:41:28 -07:00
changes_linux.go ino and dev must both match for a file to be identical. 2015-05-05 11:06:54 -04:00
changes_other.go Windows: Docker build starting to work 2015-06-17 10:41:28 -07:00
changes_posix_test.go pkg/archive: test that confirms hardlink ordering 2015-02-06 18:14:38 +01:00
changes_test.go Add the parent directory to changes set if new files are generated 2015-06-10 20:29:29 +08:00
changes_unix.go Windows: Archive package changes for Windows daemon 2015-05-20 08:55:54 -07:00
changes_windows.go Windows: Archive package changes for Windows daemon 2015-05-20 08:55:54 -07:00
copy.go Fix docker cp Behavior With Symlinks 2015-07-30 12:14:28 -07:00
copy_test.go Fix docker cp Behavior With Symlinks 2015-07-30 12:14:28 -07:00
diff.go archive, chrootarchive: split out decompression 2015-07-28 16:36:38 -04:00
diff_test.go Finally remove our copy of "archive/tar" now that Go 1.4 is the minimum! 2015-05-01 16:01:10 -06: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 linting changes 2015-06-17 01:16:57 +03:00
wrap.go Finally remove our copy of "archive/tar" now that Go 1.4 is the minimum! 2015-05-01 16:01:10 -06: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.