From: Alexander Popov Date: Sun, 13 Aug 2023 19:39:11 +0000 (+0300) Subject: Add the / symbol to the sysctl parsing pattern X-Git-Tag: v0.6.6~98 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=e2ecf1ab64d1f4193eddff47df362afce2385c09;p=kconfig-hardened-check.git 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. --- 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):