overlayWhiteoutConverter: fixes and cleanups - #52
Merged
Conversation
Store xattr to use when constructing the converter based on whether we're running with user-namespaces enabled. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- touch-up comments - explicitly return nil-error - use strings.CutPrefix instead of manually Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #52 +/- ##
==========================================
- Coverage 66.35% 65.50% -0.85%
==========================================
Files 42 42
Lines 2027 2038 +11
==========================================
- Hits 1345 1335 -10
- Misses 497 531 +34
+ Partials 185 172 -13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR refines the Linux overlay whiteout conversion logic used during tar pack/unpack, making behavior safer and more explicit when encountering malformed or AUFS-internal whiteout entries.
Changes:
- Introduces a constructor for
overlayWhiteoutConverterthat stores the selected opaque xattr name (trusted.overlay.opaquevsuser.overlay.opaque) once. - Refactors
ConvertReadinto aswitch, improving readability and explicitly returningnilerrors on non-error paths. - Rejects malformed
.wh.entries and ignores AUFS.wh..wh.plnkhardlink metadata so it isn’t mis-converted into an overlay whiteout.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
thaJeztah
force-pushed
the
cleanup_whiteout
branch
from
July 20, 2026 11:28
a981a8d to
10b81d8
Compare
thaJeztah
force-pushed
the
cleanup_whiteout
branch
from
July 20, 2026 11:32
10b81d8 to
b2656e2
Compare
thaJeztah
force-pushed
the
cleanup_whiteout
branch
from
July 20, 2026 11:39
b2656e2 to
5f817e6
Compare
Rewrite to use a switch, and reject whiteout entries whose basename is exactly ".wh." without a filepath. Such entries do not identify a whiteout target and would otherwise result in attempting a filesystem operation on the parent directory (or an empty path), failing with a less informative filesystem error. Also reject malformed entries whose target resolves to "." or "..". Archive path traversal remains handled by Untar's normal path validation. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
thaJeztah
force-pushed
the
cleanup_whiteout
branch
from
July 20, 2026 12:12
5f817e6 to
0a0e9fd
Compare
thaJeztah
marked this pull request as ready for review
July 20, 2026 12:17
vvoland
approved these changes
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
overlayWhiteoutConverter: fixes and cleanups
overlayWhiteoutConverter: store xattr name as field
Store xattr to use when constructing the converter based on whether
we're running with user-namespaces enabled.
overlayWhiteoutConverter.ConvertRead: minor cleanups
overlayWhiteoutConverter.ConvertRead: reject malformed whiteout names
Rewrite to use a switch, and reject whiteout entries whose basename is
exactly ".wh." without a filepath.
Such entries do not identify a whiteout target and would otherwise result
in attempting a filesystem operation on the parent directory (or an empty
path), failing with a less informative filesystem error.
Also reject malformed entries whose target resolves to "." or "..". Archive
path traversal remains handled by Untar's normal path validation.