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

Add target's alive test method before starting a scan #947

Merged
merged 2 commits into from
Jan 20, 2020

Conversation

jjnicola
Copy link
Member

Depends on pr greenbone/gvm-libs#312

@jjnicola jjnicola marked this pull request as ready for review January 17, 2020 15:14
src/manage.c Outdated
@@ -4103,6 +4104,10 @@ launch_osp_openvas_task (task_t task, target_t target, const char *scan_id,
hosts_str = target_hosts (target);
ports_str = target_port_range (target);
exclude_hosts_str = target_exclude_hosts (target);

if (target_alive_tests (target) >= 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alive_test should be init'd if condition is false.

@jjnicola jjnicola force-pushed the alive-test branch 2 times, most recently from 289e1cb to 947e092 Compare January 20, 2020 11:10
src/manage.c Outdated
@@ -4071,6 +4071,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;
int alive_test = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency, please keep initialisations out of the declaration block in gvmd. Like how config and connection are done below.

I know some places in gvmd do it, but I've been trying to prevent new code from doing it because it got messy.

@mattmundell mattmundell merged commit 3fea80d into greenbone:master Jan 20, 2020
@jjnicola jjnicola deleted the alive-test branch January 20, 2020 11:46
@jjnicola
Copy link
Member Author

@mattmundell Thanks for the reviews!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants