Symlink resolver and get_software_entry return value change related bugfixes #131
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.
Summary
If merged this pull request will fix several issues related to resolving symlinks, and the get_software_entry returning a tuple that needs unpacking when used to get an entry for an "archive" file. Some of the things fixed are described some in #130.
The most complex bug involved symlink resolution, when the extractpath corresponds to a subfolder on the system that the files came from (e.g.
C:/Squashfs-usrbin/
corresponds to an install prefix of/usr/bin
). During symlink resolution, this would result in a symlink such asfileA -> /usr/bin/fileB
getting resolved toC:/Squashfs-usrbin/usr/bin/fileB
, whereas it should actually beC:/Squashfs-usrbin
sinceC:/Squashfs-usrbin
==/usr/bin
on the original file system.One gotcha that still exists is if the symlink points to either a directory outside
/usr/bin
such as/bin
or/sbin
(or multiple extract paths correspond to the same install prefix), the symlink resolver doesn't know about any file system trees outside of the current extract path folder being looked at. Addressing this gets complicated though, and ties in with SBOMs created from files that come from completely different systems.Proposed changes
entry
variable