Skip to content

Commit

Permalink
Merge pull request #710 from jjnicola/del-stopped
Browse files Browse the repository at this point in the history
Send delete command to ospd after stopping the task.
  • Loading branch information
mattmundell authored Aug 21, 2019
2 parents 8d5f085 + 8e0a86d commit e7fe024
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Add -f arg to sendmail call in email alert [#676](https://github.com/greenbone/gvmd/pull/676) [#678](https://github.com/greenbone/gvmd/pull/678)
- Change get_tickets to use the status text for filtering. [#697](https://github.com/greenbone/gvmd/pull/697)
- Made checks to prevent duplicate user names stricter. [#708](https://github.com/greenbone/gvmd/pull/708)
- Send delete command to ospd after stopping the task. [#710](https://github.com/greenbone/gvmd/pull/710)

### Fixed
- A PostgreSQL statement order issue [#611](https://github.com/greenbone/gvmd/issues/611) has been addressed [#642](https://github.com/greenbone/gvmd/pull/642)
Expand Down
11 changes: 11 additions & 0 deletions src/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -5028,6 +5028,17 @@ stop_osp_task (task_t task)
set_task_run_status (task, TASK_STATUS_STOP_REQUESTED);
ret = osp_stop_scan (connection, scan_id, NULL);
osp_connection_close (connection);
if (ret)
{
g_free (scan_id);
goto end_stop_osp;
}

connection = osp_scanner_connect (task_scanner (task));
if (!connection)
goto end_stop_osp;
ret = osp_delete_scan (connection, scan_id);
osp_connection_close (connection);
g_free (scan_id);

end_stop_osp:
Expand Down

0 comments on commit e7fe024

Please sign in to comment.