LLNL / Surfactant

Modular framework for file information extraction and dependency analysis to generate accurate SBOMs
MIT License
20 stars 14 forks source link

Fix: plugins running multiple times on the same file due to symlinks #216

Closed nightlark closed 2 months ago

nightlark commented 3 months ago

Summary

If merged this pull request will refactor the logic used for handling symlinks so that plugins do not run multiple times for the same file, along with changing the way symlink file names are added so they don't depend on the user specifying an install prefix.

Plugins will still run multiple times if there are separate files that happen to have identical hashes -- which could cause a similar problem with the cve-bin-tool plugin as this change solves for symlinks. Some plugins might need to gather information from other files relative to the one they are looking at.

  1. Should an extra optional argument be added to the info extractor hook to tell the plugin if a file with the same hash has previously been seen, so it can adjust its behavior accordingly?
  2. Should a separate info extraction hook be added for duplicate files in different locations?

Proposed changes

Resolves #215