Skip to content

Commit

Permalink
Skip the kernel version part after '-'
Browse files Browse the repository at this point in the history
Example:
# Linux/x86_64 6.7.4-200.fc39.x86_64 Kernel Configuration

Refers to #88, #89, #97
  • Loading branch information
a13xp0p0v committed Mar 9, 2024
1 parent 98ccb21 commit 03863c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel_hardening_checker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"'
Expand Down

0 comments on commit 03863c0

Please sign in to comment.