mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
suppress executable parsing issues (#2614)
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
parent
c0f43e5e2d
commit
8683cba081
@ -149,7 +149,7 @@ func processExecutable(loc file.Location, reader unionreader.UnionReader) (*file
|
|||||||
|
|
||||||
securityFeatures, err := findSecurityFeatures(format, reader)
|
securityFeatures, err := findSecurityFeatures(format, reader)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithFields("error", err).Warnf("unable to determine security features for %q", loc.RealPath)
|
log.WithFields("error", err).Tracef("unable to determine security features for %q", loc.RealPath)
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,10 +228,12 @@ func findSecurityFeatures(format file.ExecutableFormat, reader unionreader.Union
|
|||||||
switch format { //nolint: gocritic
|
switch format { //nolint: gocritic
|
||||||
case file.ELF:
|
case file.ELF:
|
||||||
return findELFSecurityFeatures(reader) //nolint: gocritic
|
return findELFSecurityFeatures(reader) //nolint: gocritic
|
||||||
// case file.PE:
|
case file.PE:
|
||||||
// return findPESecurityFeatures(reader)
|
// return findPESecurityFeatures(reader)
|
||||||
// case file.MachO:
|
return nil, nil
|
||||||
// return findMachOSecurityFeatures(reader)
|
case file.MachO:
|
||||||
|
// return findMachOSecurityFeatures(reader)
|
||||||
|
return nil, nil
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("unsupported executable format: %q", format)
|
return nil, fmt.Errorf("unsupported executable format: %q", format)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,7 +45,7 @@ func hasAnyDynamicSymbols(file *elf.File, symbolNames ...string) *bool {
|
|||||||
dynSyms, err := file.DynamicSymbols()
|
dynSyms, err := file.DynamicSymbols()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// TODO: known-unknowns
|
// TODO: known-unknowns
|
||||||
log.WithFields("error", err).Warn("unable to read dynamic symbols from elf file")
|
log.WithFields("error", err).Trace("unable to read dynamic symbols from elf file")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,7 +112,7 @@ func hasElfDynFlag(f *elf.File, flag elf.DynFlag) bool {
|
|||||||
vals, err := f.DynValue(elf.DT_FLAGS)
|
vals, err := f.DynValue(elf.DT_FLAGS)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// TODO: known-unknowns
|
// TODO: known-unknowns
|
||||||
log.WithFields("error", err).Warn("unable to read DT_FLAGS from elf file")
|
log.WithFields("error", err).Trace("unable to read DT_FLAGS from elf file")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
for _, val := range vals {
|
for _, val := range vals {
|
||||||
@ -127,7 +127,7 @@ func hasElfDynFlag1(f *elf.File, flag elf.DynFlag1) bool {
|
|||||||
vals, err := f.DynValue(elf.DT_FLAGS_1)
|
vals, err := f.DynValue(elf.DT_FLAGS_1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// TODO: known-unknowns
|
// TODO: known-unknowns
|
||||||
log.WithFields("error", err).Warn("unable to read DT_FLAGS_1 from elf file")
|
log.WithFields("error", err).Trace("unable to read DT_FLAGS_1 from elf file")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
for _, val := range vals {
|
for _, val := range vals {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user