From e2ecf1ab64d1f4193eddff47df362afce2385c09 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sun, 13 Aug 2023 22:39:11 +0300 Subject: [PATCH] Add the / symbol to the sysctl parsing pattern The GitHub Actions virtual machine has such a sysctl: fs.binfmt_misc.llvm-14-runtime/binfmt = enabled This example shows that sysctl names may contain the / symbol. --- kconfig_hardened_check/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kconfig_hardened_check/__init__.py b/kconfig_hardened_check/__init__.py index 0502785..ee0babe 100644 --- a/kconfig_hardened_check/__init__.py +++ b/kconfig_hardened_check/__init__.py @@ -201,7 +201,7 @@ def parse_cmdline_file(mode, parsed_options, fname): def parse_sysctl_file(mode, parsed_options, fname): with open(fname, 'r', encoding='utf-8') as f: - sysctl_pattern = re.compile("[a-zA-Z0-9\._-]+ =.*$") + sysctl_pattern = re.compile("[a-zA-Z0-9/\._-]+ =.*$") for line in f.readlines(): line = line.strip() if not sysctl_pattern.match(line): -- 2.31.1