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:
98ccb21
)
Skip the kernel version part after '-'
author
Alexander Popov
<alex.popov@linux.com>
Sat, 9 Mar 2024 17:24:07 +0000
(20:24 +0300)
committer
Alexander Popov
<alex.popov@linux.com>
Sat, 9 Mar 2024 17:24:07 +0000
(20:24 +0300)
Example:
# Linux/x86_64 6.7.4-200.fc39.x86_64 Kernel Configuration
Refers to #88, #89, #97
kernel_hardening_checker/__init__.py
patch
|
blob
|
history
diff --git
a/kernel_hardening_checker/__init__.py
b/kernel_hardening_checker/__init__.py
index 2fa789d4fbd2c1883e9b1b46157a21041ada74b7..4855a59445bca6e120e8347aa0a1dba1994e1705 100644
(file)
--- a/
kernel_hardening_checker/__init__.py
+++ b/
kernel_hardening_checker/__init__.py
@@
-53,7
+53,7
@@
def detect_kernel_version(fname):
if ver_pattern.match(line):
line = line.strip()
parts = line.split()
- ver_str = parts[2]
+ ver_str = parts[2]
.split('-', 1)[0]
ver_numbers = ver_str.split('.')
if len(ver_numbers) < 3 or not ver_numbers[0].isdigit() or not ver_numbers[1].isdigit():
msg = f'failed to parse the version "{ver_str}"'