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

Only send the signal if the pid is a positive value. #593

Merged
merged 1 commit into from
Aug 31, 2020
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 @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fork vhosts before creating the socket.[#576](https://github.com/greenbone/openvas/pull/576)
- Check if another forked child has already added the same vhost. [#581](https://github.com/greenbone/openvas/pull/581)
- Send duplicated hosts as dead hosts to ospd, to adjust scan progress calculation. [#586](https://github.com/greenbone/openvas/pull/586)
- Only send the signal if the pid is a positive value. [#593](https://github.com/greenbone/openvas/pull/593)

[20.08]: https://github.com/greenbone/openvas/compare/v20.8.0...openvas-20.08

Expand Down
7 changes: 7 additions & 0 deletions src/openvas.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,13 @@ stop_single_task_scan (void)
exit (1);

pid = kb_item_get_int (kb, "internal/ovas_pid");

/* Only send the signal if the pid is a positive value.
Since kb_item_get_int() will return -1 if the key does
not exist. killing with -1 pid will send the signal system wide.
*/
if (pid <= 0)
return;
kill (pid, SIGUSR1);

exit (0);
Expand Down