Skip to content

Commit

Permalink
Allow plugins to run that do not have platform config value (kevoreil…
Browse files Browse the repository at this point in the history
…ly#2157)

* Allow plugins to run that do not have platform config value
Follow on from kevoreilly#2154, fix a bug where no results are returned if `options.plaform` exists but is `None`.

* Update comment for platform-specific plugin code
  • Loading branch information
josh-feather authored Jun 7, 2024
1 parent 25fa621 commit b940693
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/cuckoo/core/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,11 @@ def process(self, module):
if not options.enabled:
return None

# Check if the module is platform specific, such as strace, to prevent
# break processing.
# Check if the module is platform specific (e.g. strace) to prevent
# processing errors.
platform = self.task.get("platform", "")
if hasattr(options, "platform") and options.platform != platform:
log.debug("Plugin not compatible with platform: %s", platform)
if getattr(options, "platform", None) and options.platform != platform:
log.debug("Plugin %s not compatible with platform: %s", module_name, platform)
return None

# Give it path to the analysis results.
Expand Down

0 comments on commit b940693

Please sign in to comment.