projects
/
kconfig-hardened-check.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8a9014f
)
Add the / symbol to the sysctl parsing pattern
author
Alexander Popov
<alex.popov@linux.com>
Sun, 13 Aug 2023 19:39:11 +0000
(22:39 +0300)
committer
Alexander Popov
<alex.popov@linux.com>
Sun, 13 Aug 2023 19:39:11 +0000
(22:39 +0300)
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
patch
|
blob
|
history
diff --git
a/kconfig_hardened_check/__init__.py
b/kconfig_hardened_check/__init__.py
index 0502785b893b321796c6034720dad33df3b7d827..ee0babe223e0cc3977b2ac1ee29a1ce011fb32a8 100644
(file)
--- 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):