From: Alexander Popov Date: Sun, 27 Mar 2022 20:30:33 +0000 (+0300) Subject: Add '--cmdline' argument for the tool X-Git-Tag: v0.6.1~158^2~8 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=7425f0e25184bf3d3d2c6039f3d40dcf3fcfc4cd;p=kconfig-hardened-check.git Add '--cmdline' argument for the tool --- diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py index 7324a9e..82aef99 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -817,6 +817,8 @@ def main(): help='print security hardening preferences for the selected architecture') parser.add_argument('-c', '--config', help='check the kernel kconfig file against these preferences') + parser.add_argument('-l', '--cmdline', + help='check the kernel cmdline file against these preferences') parser.add_argument('-m', '--mode', choices=report_modes, help='choose the report mode') args = parser.parse_args() @@ -832,6 +834,8 @@ def main(): if args.config: if mode != 'json': print('[+] Kconfig file to check: {}'.format(args.config)) + if args.cmdline: + print('[+] Kernel cmdline file to check: {}'.format(args.cmdline)) arch, msg = detect_arch(args.config, supported_archs) if not arch: @@ -863,6 +867,8 @@ def main(): print_checklist(mode, config_checklist, True) sys.exit(0) + elif args.cmdline: + sys.exit('[!] ERROR: checking cmdline doesn\'t work without checking kconfig') if args.print: if mode in ('show_ok', 'show_fail'):