diff --git a/CHANGELOG.md b/CHANGELOG.md index 06c0240db..a5798b9fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,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) 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);