Commit Graph

20 Commits

Author SHA1 Message Date
Kunal Kushwaha
b12c3215a0 Licence header added
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
2018-02-19 10:32:26 +09:00
Derek McGowan
2a2c8aafba
Add test for consecutive directory removal
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-02-12 10:43:16 -08:00
Brian Goff
c776b6d8d9 Use continuity fs package
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-02-07 12:40:52 -05:00
Derek McGowan
d778dd15d8
Fixes missing whiteout parent directories
Ensures include parents is called for whiteouts

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-02-02 17:02:14 -08:00
Derek McGowan
dfadd8ce75
Fix duplicate directories entries on metadata change
Currently directory changes are not added to the list of
included directories, allowing those directories to receive
duplicate entries where there is both a metadata change to the
directory and a change to a file under that directory.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-01-24 14:28:51 -08:00
Derek McGowan
384d46d8bd
archive: check whiteout path before removal
Ensure whiteout is not pointing to the current directory
or parent directory before removing. Protects against invalid
removal of the parent or current directory.

Add whiteout related tar tests using manufactured tar conditions.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-01-12 11:43:39 -08:00
Derek McGowan
c9dd974c27
Add parent directories to tar
Alternate solution which better accounts for hard links.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-01-02 16:01:31 -08:00
Derek McGowan
d4317a1b0d
Fix parent directories not included in tar
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-12-15 12:04:47 -08:00
Michael Crosby
f43b7acfd2 Update files based on go lint
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-10-02 10:15:28 -04:00
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
Kenfe-Mickael Laventure
eb4e0b5fb1
Add AppVeyor configuration
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
2017-07-21 18:19:51 +02: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
Derek McGowan
c2c490c66c
Add test suite for filesystem tests
Updates tar tests to use test suite
Add hardlink tests

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-05-03 10:46:46 -07:00
Derek McGowan
2b186fd1f6
Update tar test to avoid touching before hardlinking
Touching the file before hardlinking was covering up a bug in
how hard links are handled in tar. Without the touch the hardlink
should still be included and both files should hardlink after
the tar is applied.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-04-04 15:00:12 -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
Akihiro Suda
750cdc951f snapshotter: add more assertion
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-03-06 08:34:43 +00:00
Derek McGowan
3c94bf814e Add deletion test
Test deleting multiple files, directories, and creating
the equivalent of an opaque directory.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2017-02-17 13:58:48 -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