]> git.ipfire.org Git - thirdparty/systemd.git/commit
dlopen: take log_level argument and log in fallback stubs
authorDaan De Meyer <daan@amutable.com>
Tue, 21 Apr 2026 10:56:21 +0000 (10:56 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 22 Apr 2026 15:41:42 +0000 (17:41 +0200)
commitd49f3f287a0bf72b5b473980cf435f0c0c2413d0
tree16058231759cdbcded10ec41b7fb011f60526681
parent2d28d3cb9173f357cbcd430e6a1164255332463f
dlopen: take log_level argument and log in fallback stubs

Every dlopen_xxx() helper now takes an int log_level argument. It is
passed through to dlopen_many_sym_or_warn() (which in turn propagates it
to dlopen_verbose() for the library-not-installed case), and is used by
the fallback stub when support for the library is not compiled in to
emit a "<lib> support is not compiled in." message at the caller's level.
Callers pass LOG_DEBUG when gracefully degrading, or a higher level when
the failure should surface, and no longer need to log redundantly at the
call site.

As part of this, dlopen_bpf_full() (which already took a log_level) is
merged into dlopen_bpf() rather than keeping both.

The static inline fallbacks used to live in the headers, which required
pulling log.h in from every header that declared a dlopen_xxx(). Move
them into the .c files instead: the declaration is always outside the
#if HAVE_XXX block, the impl sits outside the outer #if HAVE_XXX wrap
with its own internal #if HAVE_XXX/#else/#endif, and apparmor-util.c,
idn-util.c, libmount-util.c and pam-util.c are now always compiled so
they can host their stubs.
112 files changed:
src/analyze/analyze-security.c
src/basic/compress.c
src/basic/compress.h
src/basic/dlfcn-util.c
src/basic/dlfcn-util.h
src/basic/gcrypt-util.c
src/basic/gcrypt-util.h
src/core/bpf-bind-iface.c
src/core/bpf-restrict-fs.c
src/core/bpf-restrict-ifaces.c
src/core/bpf-socket-bind.c
src/core/exec-invoke.c
src/core/execute.c
src/core/main.c
src/core/mount.c
src/core/namespace.c
src/core/selinux-setup.c
src/creds/creds.c
src/dissect/dissect.c
src/growfs/growfs.c
src/home/homework-luks.c
src/home/homework.c
src/home/pam_systemd_home.c
src/imds/imdsd.c
src/import/import-common.c
src/import/test-tar.c
src/journal-remote/journal-upload.c
src/libsystemd/sd-device/test-sd-device.c
src/locale/xkbcommon-util.c
src/login/pam_systemd.c
src/login/pam_systemd_loadkey.c
src/network/networkd-sysctl.c
src/nspawn/nspawn-oci.c
src/nspawn/nspawn.c
src/nsresourced/userns-restrict.c
src/portable/portable.c
src/repart/repart.c
src/report/report-upload.c
src/resolve/resolved-util.c
src/shared/acl-util.c
src/shared/acl-util.h
src/shared/apparmor-util.c
src/shared/apparmor-util.h
src/shared/blkid-util.c
src/shared/blkid-util.h
src/shared/bpf-dlopen.c
src/shared/bpf-dlopen.h
src/shared/bpf-link.c
src/shared/cryptsetup-util.c
src/shared/cryptsetup-util.h
src/shared/curl-util.c
src/shared/curl-util.h
src/shared/dissect-image.c
src/shared/dns-domain.c
src/shared/elf-util.c
src/shared/elf-util.h
src/shared/fdisk-util.c
src/shared/fdisk-util.h
src/shared/find-esp.c
src/shared/idn-util.c
src/shared/idn-util.h
src/shared/libarchive-util.c
src/shared/libarchive-util.h
src/shared/libaudit-util.c
src/shared/libaudit-util.h
src/shared/libcrypt-util.c
src/shared/libcrypt-util.h
src/shared/libfido2-util.c
src/shared/libfido2-util.h
src/shared/libmount-util.c
src/shared/libmount-util.h
src/shared/meson.build
src/shared/module-util.c
src/shared/module-util.h
src/shared/mount-util.c
src/shared/pam-util.c
src/shared/pam-util.h
src/shared/password-quality-util-passwdqc.c
src/shared/password-quality-util-passwdqc.h
src/shared/password-quality-util-pwquality.c
src/shared/password-quality-util-pwquality.h
src/shared/pcre2-util.c
src/shared/pcre2-util.h
src/shared/pcrextend-util.c
src/shared/pkcs11-util.c
src/shared/pkcs11-util.h
src/shared/qrcode-util.c
src/shared/qrcode-util.h
src/shared/reread-partition-table.c
src/shared/seccomp-util.c
src/shared/seccomp-util.h
src/shared/selinux-util.c
src/shared/selinux-util.h
src/shared/shift-uid.c
src/shared/tar-util.c
src/shared/tpm2-util.c
src/shared/tpm2-util.h
src/shutdown/detach-swap.c
src/sysext/sysext.c
src/sysupdate/sysupdate-partition.c
src/sysupdate/sysupdate-resource.c
src/test/test-dlopen-so.c
src/test/test-execute.c
src/test/test-kexec.c
src/test/test-load-fragment.c
src/test/test-namespace.c
src/test/test-netlink-manual.c
src/tmpfiles/tmpfiles.c
src/udev/test-udev-rule-runner.c
src/udev/udev-builtin-blkid.c
src/udev/udevd.c
src/validatefs/validatefs.c