From 9d8e3d974a63aeb71ace8e879de0631554d86225 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Wed, 4 Sep 2024 16:20:15 +0300 Subject: [PATCH] sysctl parsing: Allow missing space before '=' --- kernel_hardening_checker/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel_hardening_checker/__init__.py b/kernel_hardening_checker/__init__.py index 2f70b4c..e0f1c97 100755 --- a/kernel_hardening_checker/__init__.py +++ b/kernel_hardening_checker/__init__.py @@ -206,7 +206,7 @@ def parse_sysctl_file(mode: StrOrNone, parsed_options: Dict[str, str], fname: st sys.exit(f'[!] ERROR: unable to open {fname}, are you sure it exists?') with open(fname, 'r', encoding='utf-8') as f: - sysctl_pattern = re.compile(r"[a-zA-Z0-9/\._-]+ =.*$") + sysctl_pattern = re.compile(r"[a-zA-Z0-9/\._-]+ ?=.*$") for line in f.readlines(): line = line.strip() if not sysctl_pattern.match(line): -- 2.31.1