Skip to content

Commit

Permalink
Add: scan ID to log reference (#1314)
Browse files Browse the repository at this point in the history
To be able to detect corresponing log messages, the scan ID is now logged for every message for start and stop scan
  • Loading branch information
Kraemii authored Feb 3, 2023
1 parent 6809da6 commit 178be6f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/openvas.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,12 @@ openvas (int argc, char *argv[], char *env[])
}
tzset ();

#ifdef LOG_REFERENCES_AVAILABLE
if (scan_id)
set_log_reference (scan_id);
if (stop_scan_id)
set_log_reference (stop_scan_id);
#endif // LOG_REFERENCES_AVAILABLE
if (init_logging () != 0)
return EXIT_FAILURE;

Expand Down Expand Up @@ -601,6 +607,9 @@ openvas (int argc, char *argv[], char *env[])
set_scan_id (g_strdup (stop_scan_id));
err = stop_single_task_scan ();
gvm_close_sentry ();
#ifdef LOG_REFERENCES_AVAILABLE
free_log_reference ();
#endif // LOG_REFERENCES_AVAILABLE
return err ? EXIT_FAILURE : EXIT_SUCCESS;
}

Expand All @@ -621,6 +630,9 @@ openvas (int argc, char *argv[], char *env[])

gvm_close_sentry ();
destroy_scan_globals (globals);
#ifdef LOG_REFERENCES_AVAILABLE
free_log_reference ();
#endif // LOG_REFERENCES_AVAILABLE
return EXIT_SUCCESS;
}

Expand Down

0 comments on commit 178be6f

Please sign in to comment.