Skip to content

Commit

Permalink
Improve the output
Browse files Browse the repository at this point in the history
  • Loading branch information
a13xp0p0v committed Oct 6, 2024
1 parent df50315 commit b882a2b
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions kernel_hardening_checker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,19 +373,20 @@ def main() -> None:
if mode != 'json':
print(f'[+] Special report mode: {mode}')

if mode != 'json':
if args.config:
print(f'[+] Kconfig file to check: {args.config}')
if args.cmdline:
print(f'[+] Kernel cmdline file to check: {args.cmdline}')
if args.sysctl:
print(f'[+] Sysctl output file to check: {args.sysctl}')

if args.config:
if args.print:
sys.exit('[!] ERROR: --config and --print can\'t be used together')
if args.generate:
sys.exit('[!] ERROR: --config and --generate can\'t be used together')

if mode != 'json':
print(f'[+] Kconfig file to check: {args.config}')
if args.cmdline:
print(f'[+] Kernel cmdline file to check: {args.cmdline}')
if args.sysctl:
print(f'[+] Sysctl output file to check: {args.sysctl}')

if args.kernel_version:
kernel_version, msg = detect_kernel_version(args.kernel_version)
else:
Expand All @@ -407,10 +408,6 @@ def main() -> None:
sys.exit('[!] ERROR: --sysctl and --print can\'t be used together')
if args.generate:
sys.exit('[!] ERROR: --sysctl and --generate can\'t be used together')

if mode != 'json':
print(f'[+] Sysctl output file to check: {args.sysctl}')

perform_checking(mode, None, None, None, args.sysctl)
sys.exit(0)

Expand Down

0 comments on commit b882a2b

Please sign in to comment.