feat(kernel): Canonical Livepatch's status as root, for the kernel facts (NetOrk/netork#2701)

Where the status does not read without root, the kernel facts read it again
through the driver's sudo: one fixed, read-only command.
This commit is contained in:
Christian Manivong committed 2026-11-28 04:23:25 +01:00
1 parent e0c083e0c0
commit f6fed234cd
2 files changed
+21 -1

No files matched your search

+7 -1
View File
@@ -11,7 +11,9 @@ would read as clean. It is one fixed command and reads no stdin.
The running backups need no root: every process's command line and cgroup are
readable to the login user (``_running_backups``). How the host is hardened
(``_hardening``) and who can log in to it (``_logins``, NetOrk/netork#2707) are read
as root first, as the login user where root is refused.
as root first, as the login user where root is refused. Canonical Livepatch's status
(napalm-device-types' kernel facts, NetOrk/netork#2701) is read again as root where
it did not read without: one fixed, read-only command, no stdin.
"""
from __future__ import annotations
@@ -60,3 +62,7 @@ class LinuxProcessReadingsMixin(
def _run_services_restart_command(self, command: str) -> str:
return self._run_privileged(command, _READ_TIMEOUT)
def _run_livepatch_status_command(self, command: str) -> str:
"""Canonical Livepatch's status as root, for ``KernelFactsMixin`` (#2701)."""
return self._run_privileged(command, _READ_TIMEOUT)