mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 00:43:20 +01:00
fix: logging level for parsing potential PE files (#2367)
Signed-off-by: Keith Zantow <kzantow@gmail.com>
This commit is contained in:
parent
c379d21e9a
commit
f5a6b5a02f
@ -26,27 +26,29 @@ func parseDotnetPortableExecutable(_ file.Resolver, _ *generic.Environment, f fi
|
|||||||
|
|
||||||
peFile, err := pe.NewBytes(by, &pe.Options{})
|
peFile, err := pe.NewBytes(by, &pe.Options{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, fmt.Errorf("unable to create PE file instance: %w", err)
|
// TODO: known-unknown
|
||||||
|
log.Tracef("unable to create PE instance for file '%s': %v", f.RealPath, err)
|
||||||
|
return nil, nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
err = peFile.Parse()
|
err = peFile.Parse()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, fmt.Errorf("unable to parse PE file: %w", err)
|
// TODO: known-unknown
|
||||||
|
log.Tracef("unable to parse PE file '%s': %v", f.RealPath, err)
|
||||||
|
return nil, nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
versionResources, err := peFile.ParseVersionResources()
|
versionResources, err := peFile.ParseVersionResources()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// this is not a fatal error, just log and continue
|
// TODO: known-unknown
|
||||||
// TODO: consider this case for "known unknowns" (same goes for cases below)
|
log.Tracef("unable to parse version resources in PE file: %s: %v", f.RealPath, err)
|
||||||
log.Tracef("unable to parse version resources in PE file: %s", f.RealPath)
|
|
||||||
return nil, nil, nil
|
return nil, nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
dotNetPkg, err := buildDotNetPackage(versionResources, f)
|
dotNetPkg, err := buildDotNetPackage(versionResources, f)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// this is not a fatal error, just log and continue
|
// TODO: known-unknown
|
||||||
// TODO: consider this case for "known unknowns" (same goes for cases below)
|
log.Tracef("unable to build dotnet package: %v", err)
|
||||||
log.Tracef("unable to build dotnet package: %w", err)
|
|
||||||
return nil, nil, nil
|
return nil, nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user