Report each hardlink as its own file when scanning images#5029
Open
wagoodman wants to merge 2 commits into
Open
Report each hardlink as its own file when scanning images#5029wagoodman wants to merge 2 commits into
wagoodman wants to merge 2 commits into
Conversation
image scans previously collapsed a set of hardlinks onto a single file, so only one path per inode showed up in results. dir scans report every hardlink path, which made image vs dir SBOMs of the same filesystem diverge (and produce different SPDX `packageVerificationCode` values for packages that own hardlinked files). now both image resolvers (squash and all-layers) surface each hardlink at its own path as a regular file bound to the target's content, matching dir scans. user-facing impact: - SBOMs for images containing hardlinks will list more `file` entries - SPDX `packageVerificationCode` values change for affected packages, now matching the equivalent `dir:` scan - adds `file.NewVirtualLocationFromImage` to the public API fixes #5019 Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
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.
Image scans previously collapsed a set of hardlinks onto a single file, so only one path per inode showed up in results. Directory scans report every hardlink path, which made image vs dir SBOMs of the same filesystem diverge (and produce different SPDX
packageVerificationCodevalues for packages that own hardlinked files).Now both image resolvers (squash and all-layers) surface each hardlink at its own path as a regular file bound to the target's content, matching dir scans.
user-facing impact:
fileentriespackageVerificationCodevalues change for affected packages, now matching the equivalentdir:scanfile.NewVirtualLocationFromImageto the public APINote
This does NOT address the
FilesByMIMETypeand other non-path based queries against the container based file resolvers. This means that though pathing/globbing will return multiple entries (for all og and hardlink types) others will only respond to regular files strictly.Type of change
Checklist
Issue references
fixes #5019