Skip to content

Commit 5283ee6

Browse files
committed
Removed --fail parameter
Removed --fail parameter and changed to exit with error code as the default behavior.
1 parent cb1df0f commit 5283ee6

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

log4j-finder.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ def main():
290290
help="be more quiet, disables banner and summary",
291291
)
292292
parser.add_argument("-b", "--no-banner", action="store_true", help="disable banner")
293-
parser.add_argument("-f", "--fail", action="store_true", help="Exit with error status when vulnerability is found")
294293
parser.add_argument(
295294
"-V", "--version", action="version", version=f"%(prog)s {__version__}"
296295
)
@@ -366,10 +365,8 @@ def main():
366365
print_summary(stats)
367366
print(f"\nElapsed time: {elapsed:.2f} seconds")
368367

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

374371
if __name__ == "__main__":
375372
try:

0 commit comments

Comments
 (0)