From c55fd41fc281e08a985e77279140013152af6497 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 13 Dec 2024 09:57:50 +0100 Subject: [PATCH] src: Stop hardcoding libc soname ia64/alpha has SONAME "libc.so.6.1" `None` works because Python is linked against libc, so the symbol is already in our address space. Fixes #21396 --- src/client/cockpit-client | 4 ++-- src/cockpit/transports.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/cockpit-client b/src/client/cockpit-client index e9260333ed17..55a2411049b2 100755 --- a/src/client/cockpit-client +++ b/src/client/cockpit-client @@ -47,11 +47,11 @@ except (ValueError, ImportError): libexecdir = os.path.realpath(__file__ + '/..') -libc6 = ctypes.cdll.LoadLibrary('libc.so.6') +sys_prctl = ctypes.CDLL(None).prctl def prctl(*args): - if libc6.prctl(*args) != 0: + if sys_prctl(*args) != 0: raise Exception('prctl() failed') diff --git a/src/cockpit/transports.py b/src/cockpit/transports.py index 913603544ac0..4fcf76121ee9 100644 --- a/src/cockpit/transports.py +++ b/src/cockpit/transports.py @@ -33,11 +33,11 @@ from .jsonutil import JsonObject, get_int -libc6 = ctypes.cdll.LoadLibrary('libc.so.6') +sys_prctl = ctypes.CDLL(None).prctl def prctl(*args: int) -> None: - if libc6.prctl(*args) != 0: + if sys_prctl(*args) != 0: raise OSError('prctl() failed')