Skip to content

Skip symlinks when creating SBOM for source tarball #232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sbom.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,12 +608,12 @@
# Now we walk the tarball and compare known files to our expected checksums in the SBOM.
# All files that aren't already in the SBOM can be added as "CPython" files.
for member in tarball.getmembers():
if member.isdir(): # Skip directories!
if not member.isfile(): # Only keep files (no symlinks)

Check warning on line 611 in sbom.py

View check run for this annotation

Codecov / codecov/patch

sbom.py#L611

Added line #L611 was not covered by tests
continue

# Get the member from the tarball. CPython prefixes all of its
# source code with 'Python-{version}/...'.
assert member.isfile() and member.name.startswith(f"Python-{cpython_version}/")
assert member.name.startswith(f"Python-{cpython_version}/")

Check warning on line 616 in sbom.py

View check run for this annotation

Codecov / codecov/patch

sbom.py#L616

Added line #L616 was not covered by tests

# Calculate the hashes, either for comparison with a known value
# or to embed in the SBOM as a new file. SHA1 is only used because
Expand Down