Skip to content

Commit

Permalink
Merge pull request #1383 from timopollmeier/report-format-exit-status
Browse files Browse the repository at this point in the history
Expect report format scripts to exit with code 0
  • Loading branch information
mattmundell authored Dec 23, 2020
2 parents f316f3b + bf38f40 commit 5f8b6cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Clarify documentation for --scan-host parameter [#1277](https://github.com/greenbone/gvmd/pull/1277)
- In result iterator access severity directly if possible [#1321](https://github.com/greenbone/gvmd/pull/1321)
- Change SCAP and CERT data to use new severity scoring [#1333](https://github.com/greenbone/gvmd/pull/1333) [#1357](https://github.com/greenbone/gvmd/pull/1357) [#1365](https://github.com/greenbone/gvmd/pull/1365)
- Expect report format scripts to exit with code 0 [#1383](https://github.com/greenbone/gvmd/pull/1383)
- Send entire families to ospd-openvas using VT_GROUP [#1384](https://github.com/greenbone/gvmd/pull/1384)
- The internal list of current Local Security Checks for the 'Closed CVEs' feature was updated [#1381](https://github.com/greenbone/gvmd/pull/1381)

Expand Down
10 changes: 4 additions & 6 deletions src/manage_sql_report_formats.c
Original file line number Diff line number Diff line change
Expand Up @@ -3451,9 +3451,8 @@ run_report_format_script (gchar *report_format_id,
}

ret = system (command);
/* Ignore the shell command exit status, because we've not
* specified what it must be in the past. */
if (ret == -1)
/* Report scripts should return 0 since version 21.04 */
if (ret == -1 || WIFEXITED(ret) == 0 || WEXITSTATUS(ret))
{
g_warning ("%s (child):"
" system failed with ret %i, %i, %s",
Expand Down Expand Up @@ -3551,9 +3550,8 @@ run_report_format_script (gchar *report_format_id,
/* Just run the command as the current user. */

ret = system (command);
/* Ignore the shell command exit status, because we've not
* specified what it must be in the past. */
if (ret == -1)
/* Report scripts should return 0 since version 21.04 */
if (ret == -1 || WIFEXITED(ret) == 0 || WEXITSTATUS(ret))
{
g_warning ("%s: system failed with ret %i, %i, %s",
__func__,
Expand Down

0 comments on commit 5f8b6cf

Please sign in to comment.