From b882a2b6c72b711159a73cc1bba82d1da6bc19c8 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Mon, 7 Oct 2024 02:03:22 +0300 Subject: [PATCH] Improve the output --- kernel_hardening_checker/__init__.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) 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) -- 2.31.1