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

Send delete command to ospd after stopping the task. #710

Merged
merged 2 commits into from
Aug 21, 2019
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 @@ -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