overlayWhiteoutConverter.ConvertRead: reject invalid AUFS hardlink metadata - #54
overlayWhiteoutConverter.ConvertRead: reject invalid AUFS hardlink metadata#54thaJeztah wants to merge 1 commit into
Conversation
924a4b0 to
a22c257
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the overlayfs whiteout conversion logic during Untar to handle the AUFS hardlink metadata directory (.wh..wh.plnk) explicitly, so it doesn’t get misinterpreted as a normal AUFS whiteout and converted into an overlay whiteout for .wh.plnk.
Changes:
- Adds an explicit case in
overlayWhiteoutConverter.ConvertReadfor AUFS hardlink metadata (.wh..wh.plnk). - Introduces a new test covering
.wh..wh.plnkentries during overlay whiteout conversion.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| archive_linux.go | Adds explicit handling for AUFS hardlink metadata entries during overlay whiteout conversion. |
| archive_linux_test.go | Adds a test intended to validate .wh..wh.plnk behavior during Untar with overlay whiteouts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| name := path.Clean(hdr.Name) | ||
| if name == WhiteoutLinkDir || strings.HasPrefix(name, WhiteoutLinkDir+"/") { | ||
| // AUFS-internal hardlink metadata is not part of the extracted filesystem. | ||
| return false, fmt.Errorf("invalid whiteout entry %q", hdr.Name) | ||
| } | ||
| base := filepath.Base(name) |
a22c257 to
363bf88
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #54 +/- ##
==========================================
- Coverage 66.35% 65.55% -0.80%
==========================================
Files 42 42
Lines 2027 2041 +14
==========================================
- Hits 1345 1338 -7
- Misses 497 531 +34
+ Partials 185 172 -13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
d9e568e to
ce62124
Compare
…tadata Handle WhiteoutLinkDir explicitly when converting whiteouts during unpack. The .wh..wh.plnk entry is AUFS-internal hardlink metadata and does not represent removal of a file. Without an explicit case, it falls through to the generic whiteout handling and is incorrectly converted into a whiteout for .wh.plnk. Treat the metadata entry as an invalid archive and return an error instead of incorrectly creating an overlay whiteout for it. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
ce62124 to
351baeb
Compare
|
Need to look what's best here; skip these files, error, or actually use them for hard-links? (UnpackLayer seems to have some logic for that through a temporary directory). |
Handle WhiteoutLinkDir explicitly when converting whiteouts during
unpack.
The .wh..wh.plnk entry is AUFS-internal hardlink metadata and does not
represent removal of a file. Without an explicit case, it falls through
to the generic whiteout handling and is incorrectly converted into a
whiteout for .wh.plnk.
Treat the metadata entry as an invalid archive and return an error
instead of incorrectly creating an overlay whiteout for it.