From af12b07da10e8a1e6b30ef21372fdfd5cd663e4d Mon Sep 17 00:00:00 2001 From: Juan Jose Nicola Date: Fri, 17 Jan 2020 16:10:09 +0100 Subject: [PATCH 1/2] Add target's alive test method before starting a scan --- src/manage.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/manage.c b/src/manage.c index e53f0ea1a..bb5765e55 100644 --- a/src/manage.c +++ b/src/manage.c @@ -4071,6 +4071,7 @@ launch_osp_openvas_task (task_t task, target_t target, const char *scan_id, { osp_connection_t *connection; char *hosts_str, *ports_str, *exclude_hosts_str, *finished_hosts_str; + int alive_test; osp_target_t *osp_target; GSList *osp_targets, *vts; GHashTable *vts_hash_table; @@ -4086,6 +4087,8 @@ launch_osp_openvas_task (task_t task, target_t target, const char *scan_id, connection = NULL; + alive_test = 0; + /* Prepare the report */ if (from) { @@ -4103,6 +4106,10 @@ launch_osp_openvas_task (task_t task, target_t target, const char *scan_id, hosts_str = target_hosts (target); ports_str = target_port_range (target); exclude_hosts_str = target_exclude_hosts (target); + + if (target_alive_tests (target) > 0) + alive_test = target_alive_tests (target); + if (finished_hosts_str) { gchar *new_exclude_hosts; @@ -4114,7 +4121,8 @@ launch_osp_openvas_task (task_t task, target_t target, const char *scan_id, exclude_hosts_str = new_exclude_hosts; } - osp_target = osp_target_new (hosts_str, ports_str, exclude_hosts_str); + osp_target = osp_target_new (hosts_str, ports_str, exclude_hosts_str, + alive_test); if (finished_hosts_str) osp_target_set_finished_hosts (osp_target, finished_hosts_str); From f3f2d5abaaa443eac9a721a288ef945f92d92f34 Mon Sep 17 00:00:00 2001 From: Juan Jose Nicola Date: Fri, 17 Jan 2020 16:12:42 +0100 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index be9822f00..5b739be7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Fix creation of "Super" permissions [#892](https://github.com/greenbone/gvmd/pull/892) - Add tags used for result NVTs to update_nvti_cache [#916](https://github.com/greenbone/gvmd/pull/916) - Apply usage_type of tasks in get_aggregates (9.0) [#912](https://github.com/greenbone/gvmd/pull/912) +- Add target's alive test method before starting a scan. [#947](https://github.com/greenbone/gvmd/pull/947) ### Removed - Remove support for "All SecInfo": removal of "allinfo" for type in get_info [#790](https://github.com/greenbone/gvmd/pull/790)