Commit Graph

63 Commits

Author SHA1 Message Date
Michael Crosby
c3872b848f Move RootPath to fs package
This moves the RootPath function out of the archive package and into the
fs package for external use.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-07-26 14:26:27 -04:00
Derek McGowan
afec478beb Update tar path resolution
Fixes bug for resolving symlinks which allowed fully resolving
an existing symlink to a path, causing some symlinks to get
overridden as symlinks to self.
Updates logic to split name into parent path, resolve the parent
path, then safely join back with the base name.
Uses the split code to ensure parent directories are created in
all cases.
Replaces `rootJoin` with filepath.Join to the root, which already
correctly cleans relative symlinks to the root.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-24 17:51:47 -07:00
Stephen Day
28e8d95a64 Merge pull request #1210 from dmcgowan/use-forked-tar
Use forked archive/tar package for go 1.8 regression
2017-07-19 15:34:55 -07:00
Derek McGowan
23aa4910c0
Use forked archive/tar package
Use fork of archive/tar to carry changes to tar for
all go versions.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-18 18:32:44 -07:00
Derek McGowan
60792458a3
Replace uses of filepath.Join in Apply
Replace cases where a tar specified name is joined to a directory
with root path to bound name to path.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-18 18:30:21 -07:00
Derek McGowan
4a3f98cb61
Add link breakout checks and tests
Ensure symlinks cannot be used to breakout of unpack directory.
Evaluate absolute symlinks as scoped to unpack directory.
Allow symlinks which point outside the root to be created.
Scope all resolution of symlinks to the unpack directory.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-18 12:16:13 -07:00
Tonis Tiigi
19aed1a049 archive: fix allocation leak
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2017-07-12 10:24:52 -07:00
Derek McGowan
3ae69c43d8
Add diff service implementation
Add snapshot subcommand to ctr for creating diffs of RW layers.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-05-16 13:48:53 -07:00
Derek McGowan
51b8e468e5
Fix hardlinks with unmodified files
Previously hardlinking to an unmodified file or linking to a file
which was touched by not detected as modified caused a new file
to be created on unpack. This new file and the original source file
were not linked since no link record was created in the tar. This
change addresses this by adding links for all hardlinks to a file
when it is detected as changed. These links will be written after
the source file is written and may occur out of order in regard to
file name.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-04-04 15:00:19 -07:00
Michael Crosby
4f2b443a27 Rewrite imports for new github org
This rewrites the Go imports after switching to the new github org.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-04-03 14:05:44 -07:00
Aaron.L.Xu
a3cae915c3 fix some typos
Signed-off-by: Aaron.L.Xu <likexu@harmonycloud.cn>
2017-02-21 15:02:36 +08:00
Derek McGowan
6443891a7d Update log lines to use containerd log package
Removed unused requires root test function and updated
tar requires function to use lookup method.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2017-02-17 11:50:49 -08:00
Derek McGowan
0deba01621 Add archive package
Archive package handles generating and applying diff tar streams
based on the OCI diff tar specification.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2017-02-17 11:49:58 -08:00