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 reverse_lookup_* options #959

Merged
merged 2 commits into from
Jan 28, 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 @@ -61,6 +61,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- 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)
- Fix QoD handling in nvti cache and test_alert [#954](https://github.com/greenbone/gvmd/pull/954)
- Add target's reverse_lookup_* options [#959](https://github.com/greenbone/gvmd/pull/959)
- Fix "Start Task" alerts by using alert owner [#957](https://github.com/greenbone/gvmd/pull/957)

### Removed
Expand Down
13 changes: 11 additions & 2 deletions src/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -4072,7 +4072,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;
int alive_test, reverse_lookup_only, reverse_lookup_unify;
osp_target_t *osp_target;
GSList *osp_targets, *vts;
GHashTable *vts_hash_table;
Expand All @@ -4089,6 +4089,8 @@ launch_osp_openvas_task (task_t task, target_t target, const char *scan_id,
connection = NULL;

alive_test = 0;
reverse_lookup_unify = 0;
reverse_lookup_only = 0;

/* Prepare the report */
if (from)
Expand All @@ -4111,6 +4113,12 @@ launch_osp_openvas_task (task_t task, target_t target, const char *scan_id,
if (target_alive_tests (target) > 0)
alive_test = target_alive_tests (target);

if (target_reverse_lookup_only (target) != NULL)
reverse_lookup_only = atoi (target_reverse_lookup_only (target));

if (target_reverse_lookup_unify (target) != NULL)
reverse_lookup_unify = atoi (target_reverse_lookup_unify (target));

if (finished_hosts_str)
{
gchar *new_exclude_hosts;
Expand All @@ -4123,7 +4131,8 @@ launch_osp_openvas_task (task_t task, target_t target, const char *scan_id,
}

osp_target = osp_target_new (hosts_str, ports_str, exclude_hosts_str,
alive_test);
alive_test, reverse_lookup_unify,
reverse_lookup_only);
if (finished_hosts_str)
osp_target_set_finished_hosts (osp_target, finished_hosts_str);

Expand Down