Skip to content

Commit

Permalink
Merge pull request #1570 from greenbone/mergify/bp/master/pr-1568
Browse files Browse the repository at this point in the history
Fix stop resume (backport #1568)
  • Loading branch information
timopollmeier authored Jun 22, 2021
2 parents 5622dbe + 69977b7 commit 7265079
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix erroneous freeing of ical timezone component [#1530](https://github.com/greenbone/gvmd/pull/1530)
- Fixed the sorting / filter by username functionality for remediation tickets [#1546](https://github.com/greenbone/gvmd/pull/1546)
- The alterable indicator is now copied when cloning a task [#1553](https://github.com/greenbone/gvmd/pull/1553)
- Fix stop resume feature. [#1568](https://github.com/greenbone/gvmd/pull/1568)

### Removed

Expand Down
17 changes: 11 additions & 6 deletions src/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -2480,7 +2480,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;
gchar *clean_hosts, *clean_exclude_hosts;
gchar *clean_hosts, *clean_exclude_hosts, *clean_finished_hosts_str;
int alive_test, reverse_lookup_only, reverse_lookup_unify;
osp_target_t *osp_target;
GSList *osp_targets, *vts, *vt_groups;
Expand Down Expand Up @@ -2511,9 +2511,13 @@ launch_osp_openvas_task (task_t task, target_t target, const char *scan_id,
else if (ret == -1)
return -1;
finished_hosts_str = report_finished_hosts_str (global_current_report);
clean_finished_hosts_str = clean_hosts_string (finished_hosts_str);
}
else
finished_hosts_str = NULL;
{
finished_hosts_str = NULL;
clean_finished_hosts_str = NULL;
}

/* Set up target(s) */
hosts_str = target_hosts (target);
Expand All @@ -2537,10 +2541,10 @@ launch_osp_openvas_task (task_t task, target_t target, const char *scan_id,
gchar *new_exclude_hosts;

new_exclude_hosts = g_strdup_printf ("%s,%s",
exclude_hosts_str,
finished_hosts_str);
free (exclude_hosts_str);
exclude_hosts_str = new_exclude_hosts;
clean_exclude_hosts,
clean_finished_hosts_str);
free (clean_exclude_hosts);
clean_exclude_hosts = new_exclude_hosts;
}

osp_target = osp_target_new (clean_hosts, ports_str, clean_exclude_hosts,
Expand All @@ -2555,6 +2559,7 @@ launch_osp_openvas_task (task_t task, target_t target, const char *scan_id,
free (finished_hosts_str);
g_free (clean_hosts);
g_free (clean_exclude_hosts);
g_free (clean_finished_hosts_str);
osp_targets = g_slist_append (NULL, osp_target);

ssh_credential = target_osp_ssh_credential (target);
Expand Down

0 comments on commit 7265079

Please sign in to comment.