From 1924fa65beb8a136eda4b8b0fe78bea8e33002d5 Mon Sep 17 00:00:00 2001 From: Elena Reshetova Date: Tue, 5 Jul 2016 09:46:19 +0300 Subject: [PATCH] meta-security-isafw: Making CVE plugin to catch non-zero exit code from cve-check-tool (From meta-security-isafw rev: 346706b8e3b19e2fe22c5aba8de8d3ad05ef9089) Signed-off-by: Elena Reshetova --- .../lib/isafw/isaplugins/ISA_cve_plugin.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/meta-security-isafw/lib/isafw/isaplugins/ISA_cve_plugin.py b/meta-security-isafw/lib/isafw/isaplugins/ISA_cve_plugin.py index 61ba8aa77ac..ab96863b654 100644 --- a/meta-security-isafw/lib/isafw/isaplugins/ISA_cve_plugin.py +++ b/meta-security-isafw/lib/isafw/isaplugins/ISA_cve_plugin.py @@ -182,9 +182,12 @@ def process_report_type(self, rtype): stdout_value = result[0] tool_stderr_value = result[1] if not tool_stderr_value : - report = self.report_name + "." + rtype - with open(report, 'wb') as freport: - freport.write(stdout_value) + if popen.returncode != 0: + tool_stderr_value = "cve-check-tool terminated with non-zero exit code " + str(popen.returncode) + else: + report = self.report_name + "." + rtype + with open(report, 'wb') as freport: + freport.write(stdout_value) return tool_stderr_value def process_patch_list(self, patch_files):