Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add target's alive test method before starting a scan #947

Merged
merged 2 commits into from
Jan 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 9 additions & 1 deletion src/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
{
Expand All @@ -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;
Expand All @@ -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);

Expand Down