Skip to content

Commit

Permalink
Removed --fail parameter
Browse files Browse the repository at this point in the history
Removed --fail parameter and changed to exit with error code as the default behavior.
  • Loading branch information
ericrbs committed Dec 28, 2021
1 parent cb1df0f commit 5283ee6
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions log4j-finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ def main():
help="be more quiet, disables banner and summary",
)
parser.add_argument("-b", "--no-banner", action="store_true", help="disable banner")
parser.add_argument("-f", "--fail", action="store_true", help="Exit with error status when vulnerability is found")
parser.add_argument(
"-V", "--version", action="version", version=f"%(prog)s {__version__}"
)
Expand Down Expand Up @@ -366,10 +365,8 @@ def main():
print_summary(stats)
print(f"\nElapsed time: {elapsed:.2f} seconds")

# If we find vulnerabilities and the args -f (or --fail), then exit with a string which cause a error status on the exit.
if args.fail:
if stats["vulnerable"]:
return "Vulnerabilities found."
# If we find vulnerabilities then exit with error code (True = 1)
return stats["vulnerable"] > 0

if __name__ == "__main__":
try:
Expand Down

0 comments on commit 5283ee6

Please sign in to comment.