Skip to content

archive: check whiteout path before removal#2001

Merged
crosbymichael merged 1 commit intocontainerd:masterfrom
dmcgowan:fix-whiteout-rootpath
Jan 12, 2018
Merged

archive: check whiteout path before removal#2001
crosbymichael merged 1 commit intocontainerd:masterfrom
dmcgowan:fix-whiteout-rootpath

Conversation

@dmcgowan
Copy link
Copy Markdown
Member

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.

credit to @tonistiigi for finding

@dmcgowan dmcgowan added this to the 1.0.1 milestone Jan 12, 2018
@tonistiigi
Copy link
Copy Markdown
Member

LGTM

1 similar comment
@stevvooe
Copy link
Copy Markdown
Member

LGTM

Comment thread archive/tar.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Wrapf(invalidArchive, "invalid whiteout name: %q", originalPath)?

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 <[email protected]>
@dmcgowan dmcgowan force-pushed the fix-whiteout-rootpath branch from f1cf89f to 384d46d Compare January 12, 2018 19:43
@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #2001 into master will increase coverage by <.01%.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2001      +/-   ##
==========================================
+ Coverage   45.57%   45.57%   +<.01%     
==========================================
  Files          94       94              
  Lines        9288     9296       +8     
==========================================
+ Hits         4233     4237       +4     
- Misses       4347     4351       +4     
  Partials      708      708
Flag Coverage Δ
#linux 50.19% <100%> (+0.02%) ⬆️
#windows 40.43% <0%> (-0.05%) ⬇️
Impacted Files Coverage Δ
archive/tar.go 43.51% <50%> (+0.12%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3292d9...384d46d. Read the comment docs.

@crosbymichael
Copy link
Copy Markdown
Member

LGTM

@crosbymichael crosbymichael merged commit bbb5b2f into containerd:master Jan 12, 2018
@dmcgowan dmcgowan deleted the fix-whiteout-rootpath branch June 5, 2018 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants