From 55093150590f161434b85c75d091adb0d7e12cb1 Mon Sep 17 00:00:00 2001 From: Juan Jose Nicola Date: Thu, 3 Sep 2020 11:48:58 +0200 Subject: [PATCH] Check if the scan was stopped before launching OpenVAS. If the scan was stopped during the preferences handling before spawining the OpenVAS process, the process was spawned but still marked as stopped. Now the scan is indeed stopped and the new process is not being spawned. --- CHANGELOG.md | 1 + ospd_openvas/daemon.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12e6f136..795b71d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - Fix nvticache name when for stable version from sources. [#317](https://github.com/greenbone/ospd-openvas/pull/317) +- Fix stop scan during preferences handling, before spawining OpenVAS. [#332](https://github.com/greenbone/ospd-openvas/pull/332) [20.8.1]: https://github.com/greenbone/ospd-openvas/compare/v20.8.0...ospd-openvas-20.08 diff --git a/ospd_openvas/daemon.py b/ospd_openvas/daemon.py index 54f19926..71183f19 100644 --- a/ospd_openvas/daemon.py +++ b/ospd_openvas/daemon.py @@ -1254,7 +1254,7 @@ def exec_scan(self, scan_id: str): # Release memory used for scan preferences. del scan_prefs - if do_not_launch: + if do_not_launch or kbdb.scan_is_stopped(openvas_scan_id): self.main_db.release_database(kbdb) return