From fafac3825b7902c78deba075fd2bda2ff8d4798d Mon Sep 17 00:00:00 2001 From: ArnoStiefvater Date: Fri, 18 Jun 2021 11:13:28 +0200 Subject: [PATCH 1/4] Use correct exclude host list Previously the wrong exlude host list was used for the target which meant the stop-resume feature was not working correctly. The original exlude hosts were used instead of the original plus the finished hosts. (cherry picked from commit cc42f6d9d53a7a7d8fc6309bb2b67e2eddf6e7dc) --- src/manage.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/manage.c b/src/manage.c index dd72135bc..69435ea53 100644 --- a/src/manage.c +++ b/src/manage.c @@ -2537,10 +2537,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, + clean_exclude_hosts, finished_hosts_str); - free (exclude_hosts_str); - exclude_hosts_str = new_exclude_hosts; + free (clean_exclude_hosts); + clean_exclude_hosts = new_exclude_hosts; } osp_target = osp_target_new (clean_hosts, ports_str, clean_exclude_hosts, From 265a845f4577bea093fce92db9f5433c152c934e Mon Sep 17 00:00:00 2001 From: ArnoStiefvater Date: Fri, 18 Jun 2021 11:21:20 +0200 Subject: [PATCH 2/4] Add changelog entry (cherry picked from commit b285f777ef58313a96ca6780d05e4934d4cee7cd) # Conflicts: # CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9079d346b..b718d1765 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) ### Removed From 08148a7fb318e085840974211f9df2b396da1d48 Mon Sep 17 00:00:00 2001 From: ArnoStiefvater Date: Tue, 22 Jun 2021 09:07:00 +0200 Subject: [PATCH 3/4] Clean finished_hosts_str before use (cherry picked from commit 202ff6fe3fe4a9c804dee7161b92fd227b4d21ce) --- src/manage.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/manage.c b/src/manage.c index 69435ea53..e89bdf0b8 100644 --- a/src/manage.c +++ b/src/manage.c @@ -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; @@ -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); @@ -2538,7 +2542,7 @@ launch_osp_openvas_task (task_t task, target_t target, const char *scan_id, new_exclude_hosts = g_strdup_printf ("%s,%s", clean_exclude_hosts, - finished_hosts_str); + clean_finished_hosts_str); free (clean_exclude_hosts); clean_exclude_hosts = new_exclude_hosts; } @@ -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); From 69977b76c77822d4ae02b148198b500be07fc12f Mon Sep 17 00:00:00 2001 From: Timo Pollmeier Date: Tue, 22 Jun 2021 09:23:31 +0200 Subject: [PATCH 4/4] Resolve conflict in CHANGELOG.md --- CHANGELOG.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b718d1765..c4aa88d99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -121,11 +121,8 @@ 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) ### Removed