You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What happened:
Sometimes syft can encounter a dpkg license where the regular expression used to match on contents cannot correctly identify the license.
In the following example we should find things like:
NVIDIA Software License Agreement and CUDA Supplement to Software License Agreement
I've tracked down a couple data sources syft could use to identify non SPDX licenses - currently looking at ways to incorporate these to the licenses identification when generating the SBOM
What happened:
Sometimes syft can encounter a dpkg license where the regular expression used to match on contents cannot correctly identify the license.
In the following example we should find things like:
Reads contents of copyright:
func fetchCopyrightContents(resolver file.Resolver, dbLocation file.Location, m pkg.DpkgDBEntry) (io.ReadCloser, *file.Location) {
if resolver == nil {
return nil, nil
}
// look for /usr/share/docs/NAME/copyright files
copyrightPath := path.Join(docsPath, m.Package, "copyright")
location := resolver.RelativeFileByPath(dbLocation, copyrightPath)
// we may not have a copyright file for each package, ignore missing files
if location == nil {
return nil, nil
}
reader, err := resolver.FileContentsByLocation(*location)
if err != nil {
log.Warnf("failed to fetch deb copyright contents (package=%s): %s", m.Package, err)
}
defer internal.CloseAndLogError(reader, location.RealPath)
l := location.WithAnnotation(pkg.EvidenceAnnotationKey, pkg.SupportingEvidenceAnnotation)
return reader, &l
}
syft/syft/pkg/cataloger/debian/package.go
Lines 252 to 276 in ca945d1
Sends contents for parsing
syft/syft/pkg/cataloger/debian/package.go
Lines 101 to 106 in ca945d1
Searches for license clause
syft/syft/pkg/cataloger/debian/parse_copyright.go
Lines 22 to 41 in 48f1e97
What you expected to happen:
Given a copyright file is found SOME license information should be created for a given package. No licenses is a bug.
Steps to reproduce the issue:
syft version
: devel (tip of main)cat /etc/os-release
or similar): OSXThe text was updated successfully, but these errors were encountered: