From b940693907fbab2849cd881863625ff38ff585bd Mon Sep 17 00:00:00 2001 From: Josh Feather <142008135+josh-feather@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:18:46 +0100 Subject: [PATCH] Allow plugins to run that do not have platform config value (#2157) * Allow plugins to run that do not have platform config value Follow on from #2154, fix a bug where no results are returned if `options.plaform` exists but is `None`. * Update comment for platform-specific plugin code --- lib/cuckoo/core/plugins.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/cuckoo/core/plugins.py b/lib/cuckoo/core/plugins.py index f42924a94ce..86aa0a040d5 100644 --- a/lib/cuckoo/core/plugins.py +++ b/lib/cuckoo/core/plugins.py @@ -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.