Skip to content

Kernel version check fails for Debian kernel #9

Description

@detlefla

In landlock/plumbing.py:149 the kernel version is checked:

kernel_version_tuple = tuple(map(int, kernel_version.split("-")[0].split(".")))

where kernel_version is the result of platform.release(). For a standard Debian kernel the reported release may look like '6.17.8+deb14-amd64'. Although the last part amd64 gets split off, the +deb14 part makes the int() call fail.

I'd suggest re.split(r"[+-]", kernel_version) but am unsure if this covers all popular version strings that could be found in the wild.

Problem occurred with landlock version 1.0.0.dev5, Python 3.12.5.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions