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

Fix stop resume (backport #1568) #1570

Merged
merged 4 commits into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Free alert get data in report_content_for_alert [#1526](https://github.com/greenbone/gvmd/pull/1526)
- 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)
<<<<<<< HEAD
- 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)
>>>>>>> b285f777e (Add changelog entry)
timopollmeier marked this conversation as resolved.
Show resolved Hide resolved

### 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