Skip to content

Commit

Permalink
fix: update exit code
Browse files Browse the repository at this point in the history
Do not return 1 if CVEs are found as under Linux, it means that the
program exited with a "General Error"

Signed-off-by: Fabrice Fontaine <[email protected]>
  • Loading branch information
ffontaine committed Jan 24, 2025
1 parent 3029cb0 commit 1943989
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cve_bin_tool/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1261,11 +1261,13 @@ def main(argv=None):
if cve_scanner.products_with_cve == 0:
return 0

# if some cves are found, return with exit code 1
# if some cves are found, also return with exit code 0
# Previously this returned a number of CVEs found, but that can
# exceed expected return value range.
# Returning 1 is also not correct as under Linux it means that
# the program exited with a "General Error"
if cve_scanner.products_with_cve > 0:
return 1
return 0

# If somehow we got negative numbers of cves something has gone
# horribly wrong. Since return code 2 is used by argparse, use 3
Expand Down

0 comments on commit 1943989

Please sign in to comment.