From: Alexander Popov Date: Sun, 6 Oct 2024 23:03:22 +0000 (+0300) Subject: Improve the output X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=b882a2b6c72b711159a73cc1bba82d1da6bc19c8;p=kconfig-hardened-check.git Improve the output --- diff --git a/kernel_hardening_checker/__init__.py b/kernel_hardening_checker/__init__.py index ee8e4e3..3e0535a 100755 --- a/kernel_hardening_checker/__init__.py +++ b/kernel_hardening_checker/__init__.py @@ -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: @@ -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)