]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dlopen-note: move all dlopen notes to dlopen-note.h
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 6 Jul 2026 03:16:41 +0000 (12:16 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 Jul 2026 07:34:26 +0000 (16:34 +0900)
This also switches all these notes to be defined via SD_ELF_NOTE_DLOPEN_ANCHORED().
Consequently, any notes added within unreachable or unused functions will be
automatically garbage-collected by the linker (--gc-sections) instead of
bloating the final binary.

E.g. unused p11-kit library dependency is now dropped from
systemd-repart.standalone binary.

Before:
```
$ systemd-analyze dlopen-metadata build/systemd-repart.standalone
FEATURE    DESCRIPTION                                                SONAME                        PRIORITY
cryptsetup Support for disk encryption, integrity, and authentication libcryptsetup.so.12           recommended
blkid      Support for block device identification                    libblkid.so.1                 required
libcrypto  Support for cryptographic operations                       libcrypto.so.4 libcrypto.so.3 recommended
mount      Support for mount enumeration                              libmount.so.1                 required
fdisk      Support for reading and writing partition tables           libfdisk.so.1                 required
blkid      Support for block device identification                    libblkid.so.1                 recommended
libcrypto  Support for cryptographic operations                       libcrypto.so.4 libcrypto.so.3 suggested
cryptsetup Support for disk encryption, integrity, and authentication libcryptsetup.so.12           suggested
fdisk      Support for reading and writing partition tables           libfdisk.so.1                 suggested
idn        Support for internationalized domain names                 libidn2.so.0                  suggested
mount      Support for mount enumeration                              libmount.so.1                 recommended
selinux    Support for SELinux                                        libselinux.so.1               recommended
tpm        Support for TPM                                            libtss2-esys.so.0             suggested
tpm        Support for TPM                                            libtss2-rc.so.0               suggested
tpm        Support for TPM                                            libtss2-mu.so.0               suggested
tpm        Support for TPM                                            libtss2-tcti-device.so.0      suggested
p11-kit    Support for PKCS11 hardware tokens                         libp11-kit.so.0               suggested
```

After:
```
$ systemd-analyze dlopen-metadata build/systemd-repart.standalone
FEATURE    DESCRIPTION                                                SONAME                        PRIORITY
cryptsetup Support for disk encryption, integrity, and authentication libcryptsetup.so.12           recommended
blkid      Support for block device identification                    libblkid.so.1                 required
libcrypto  Support for cryptographic operations                       libcrypto.so.4 libcrypto.so.3 recommended
mount      Support for mount enumeration                              libmount.so.1                 required
fdisk      Support for reading and writing partition tables           libfdisk.so.1                 required
blkid      Support for block device identification                    libblkid.so.1                 recommended
libcrypto  Support for cryptographic operations                       libcrypto.so.4 libcrypto.so.3 suggested
cryptsetup Support for disk encryption, integrity, and authentication libcryptsetup.so.12           suggested
fdisk      Support for reading and writing partition tables           libfdisk.so.1                 suggested
mount      Support for mount enumeration                              libmount.so.1                 recommended
selinux    Support for SELinux                                        libselinux.so.1               recommended
tpm        Support for TPM                                            libtss2-esys.so.0             suggested
tpm        Support for TPM                                            libtss2-rc.so.0               suggested
tpm        Support for TPM                                            libtss2-mu.so.0               suggested
tpm        Support for TPM                                            libtss2-tcti-device.so.0      suggested
```

114 files changed:
meson.build
src/analyze/analyze-security.c
src/basic/compress.c
src/basic/dlopen-note.h [new file with mode: 0644]
src/bootctl/bootctl-install.c
src/core/bpf-bind-iface.c
src/core/bpf-restrict-fs.c
src/core/bpf-restrict-fsaccess.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/cryptenroll/cryptenroll-varlink.c
src/cryptenroll/cryptenroll.c
src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-fido2.c
src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-pkcs11.c
src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-tpm2.c
src/cryptsetup/cryptsetup.c
src/dissect/dissect.c
src/growfs/growfs.c
src/home/homectl.c
src/home/homed-manager.c
src/home/homework-fscrypt.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/pull-job.c
src/integritysetup/integritysetup.c
src/journal-remote/journal-gatewayd.c
src/journal-remote/journal-remote-main.c
src/journal-remote/journal-upload.c
src/journal/journalctl-authenticate.c
src/keyutil/keyutil.c
src/locale/xkbcommon-util.c
src/login/pam_systemd.c
src/login/pam_systemd_loadkey.c
src/measure/measure-tool.c
src/network/networkd-sysctl.c
src/nspawn/nspawn-oci.c
src/nspawn/nspawn.c
src/nsresourced/userns-restrict.c
src/pcrextend/pcrextend.c
src/pcrlock/pcrlock.c
src/portable/portable.c
src/repart/repart.c
src/report/report-sign-plain.c
src/report/report-upload.c
src/resolve/resolved-dns-dnssec.c
src/resolve/resolved-dnstls.c
src/resolve/resolved-util.c
src/sbsign/sbsign.c
src/shared/acl-util.c
src/shared/acl-util.h
src/shared/apparmor-util.c
src/shared/blkid-util.c
src/shared/blkid-util.h
src/shared/bpf-util.c
src/shared/bpf-util.h
src/shared/crypto-util.c
src/shared/crypto-util.h
src/shared/cryptsetup-util.c
src/shared/cryptsetup-util.h
src/shared/curl-util.c
src/shared/curl-util.h
src/shared/dlopen-note.h [new file with mode: 0644]
src/shared/elf-util.c
src/shared/fdisk-util.c
src/shared/fdisk-util.h
src/shared/gnutls-util.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/libcrypt-util.c
src/shared/libfido2-util.c
src/shared/libmount-util.c
src/shared/libmount-util.h
src/shared/microhttpd-util.c
src/shared/microhttpd-util.h
src/shared/module-util.c
src/shared/module-util.h
src/shared/pam-util.c
src/shared/pam-util.h
src/shared/password-quality-util-passwdqc.c
src/shared/password-quality-util-pwquality.c
src/shared/pcre2-util.c
src/shared/pkcs11-util.c
src/shared/qrcode-util.c
src/shared/seccomp-util.c
src/shared/seccomp-util.h
src/shared/selinux-util.c
src/shared/selinux-util.h
src/shared/ssl-util.c
src/shared/ssl-util.h
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/tmpfiles/tmpfiles.c
src/tpm2-setup/tpm2-setup.c
src/udev/udev-builtin-blkid.c
src/udev/udevd.c
src/validatefs/validatefs.c
src/veritysetup/veritysetup.c

index b9de4656b708bfb5fc7ad289ae264b4a0302e864..30ed31b03c7bfc32457bbe72a3117d4bb17bcb41 100644 (file)
@@ -1416,11 +1416,11 @@ endif
 # In the dlopen ELF note we save the default compression library with a
 # higher priority, so that packages can give it priority over the
 # secondary libraries.
-conf.set_quoted('COMPRESSION_PRIORITY_ZSTD',
+conf.set('COMPRESSION_PRIORITY_ZSTD',
                 compression == 'zstd' ? 'recommended' : 'suggested')
-conf.set_quoted('COMPRESSION_PRIORITY_LZ4',
+conf.set('COMPRESSION_PRIORITY_LZ4',
                 compression == 'lz4' ? 'recommended' : 'suggested')
-conf.set_quoted('COMPRESSION_PRIORITY_XZ',
+conf.set('COMPRESSION_PRIORITY_XZ',
                 compression == 'xz' ? 'recommended' : 'suggested')
 conf.set('DEFAULT_COMPRESSION', 'COMPRESSION_@0@'.format(compression.to_upper()))
 
index fbef7e3d2e8aa021c5a0381debe1506495c09c55..c0481c72ec407fa2b1a8cbfa2ee1f73b0723f48c 100644 (file)
@@ -626,7 +626,7 @@ static int assess_system_call_filter(
         uint64_t b;
         int r;
 
-        r = DLOPEN_LIBSECCOMP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBSECCOMP(LOG_DEBUG, recommended);
         if (r < 0) {
                 *ret_badness = UINT64_MAX;
                 *ret_description = NULL;
@@ -2604,7 +2604,7 @@ static int get_security_info(Unit *u, ExecContext *c, CGroupContext *g, RuntimeS
                 info->_umask = c->umask;
 
 #if HAVE_SECCOMP
-                if (DLOPEN_LIBSECCOMP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) >= 0) {
+                if (DLOPEN_LIBSECCOMP(LOG_DEBUG, recommended) >= 0) {
                         SET_FOREACH(key, c->syscall_archs) {
                                 const char *name;
 
index 70d0b7ced319cfec68bffdc89d4f5edb3fedcd92..350c612eae7b66241fb9ae7213736c06e15d1dd9 100644 (file)
 #include <bzlib.h>
 #endif
 
-#include "sd-dlopen.h"
-
 #include "alloc-util.h"
 #include "bitfield.h"
 #include "compress.h"
 #include "dlfcn-util.h"
+#include "dlopen-note.h"
 #include "io-util.h"
 #include "log.h"
 #include "string-table.h"
@@ -293,11 +292,7 @@ int dlopen_xz(int log_level) {
 #if HAVE_XZ
         static void *lzma_dl = NULL;
 
-        SD_ELF_NOTE_DLOPEN(
-                        "lzma",
-                        "Support lzma compression in journal and coredump files",
-                        COMPRESSION_PRIORITY_XZ,
-                        "liblzma.so.5");
+        LIBLZMA_NOTE(COMPRESSION_PRIORITY_XZ);
 
         return dlopen_many_sym_or_warn(
                         &lzma_dl,
@@ -318,11 +313,7 @@ int dlopen_lz4(int log_level) {
 #if HAVE_LZ4
         static void *lz4_dl = NULL;
 
-        SD_ELF_NOTE_DLOPEN(
-                        "lz4",
-                        "Support lz4 compression in journal and coredump files",
-                        COMPRESSION_PRIORITY_LZ4,
-                        "liblz4.so.1");
+        LIBLZ4_NOTE(COMPRESSION_PRIORITY_LZ4);
 
         return dlopen_many_sym_or_warn(
                         &lz4_dl,
@@ -352,11 +343,7 @@ int dlopen_zstd(int log_level) {
 #if HAVE_ZSTD
         static void *zstd_dl = NULL;
 
-        SD_ELF_NOTE_DLOPEN(
-                        "zstd",
-                        "Support zstd compression in journal and coredump files",
-                        COMPRESSION_PRIORITY_ZSTD,
-                        "libzstd.so.1");
+        LIBZSTD_NOTE(COMPRESSION_PRIORITY_ZSTD);
 
         return dlopen_many_sym_or_warn(
                         &zstd_dl,
@@ -387,11 +374,7 @@ int dlopen_zlib(int log_level) {
 #if HAVE_ZLIB
         static void *zlib_dl = NULL;
 
-        SD_ELF_NOTE_DLOPEN(
-                        "zlib",
-                        "Support gzip compression and decompression",
-                        SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
-                        "libz.so.1");
+        LIBZ_NOTE(suggested);
 
         return dlopen_many_sym_or_warn(
                         &zlib_dl,
@@ -412,11 +395,7 @@ int dlopen_bzip2(int log_level) {
 #if HAVE_BZIP2
         static void *bzip2_dl = NULL;
 
-        SD_ELF_NOTE_DLOPEN(
-                        "bzip2",
-                        "Support bzip2 compression and decompression",
-                        SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
-                        "libbz2.so.1");
+        LIBBZ2_NOTE(suggested);
 
         return dlopen_many_sym_or_warn(
                         &bzip2_dl,
diff --git a/src/basic/dlopen-note.h b/src/basic/dlopen-note.h
new file mode 100644 (file)
index 0000000..302dd09
--- /dev/null
@@ -0,0 +1,91 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "sd-dlopen.h"
+
+#include "basic-forward.h"
+#include "strv.h"
+
+/* Avoid invalid priority. */
+#define _DLOPEN_CHECK_PRIORITY_required    1
+#define _DLOPEN_CHECK_PRIORITY_recommended 1
+#define _DLOPEN_CHECK_PRIORITY_suggested   1
+
+/* Unlike SD_ELF_NOTE_DLOPEN_ANCHORED(), this takes feature and priority without quotation. */
+#define ELF_NOTE_DLOPEN_ANCHORED(feature, description, priority, ...)   \
+        assert_cc(_DLOPEN_CHECK_PRIORITY_##priority);                   \
+        SD_ELF_NOTE_DLOPEN_ANCHORED(                                    \
+                        feature##_##priority,                           \
+                        STRINGIFY(feature),                             \
+                        description,                                    \
+                        STRINGIFY(priority),                            \
+                        __VA_ARGS__)
+
+#if HAVE_BZIP2
+#  define LIBBZ2_NOTE(priority)                                         \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        bzip2,                                          \
+                        "Support bzip2 compression and decompression",  \
+                        priority,                                       \
+                        "libbz2.so.1")
+#else
+#  define LIBBZ2_NOTE(priority)
+#endif
+
+#if HAVE_LZ4
+#  define LIBLZ4_NOTE(priority)                                         \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        lz4,                                            \
+                        "Support lz4 compression in journal and coredump files", \
+                        priority,                                       \
+                        "liblz4.so.1")
+#else
+#  define LIBLZ4_NOTE(priority)
+#endif
+
+#if HAVE_XZ
+#  define LIBLZMA_NOTE(priority)                                        \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        lzma,                                           \
+                        "Support lzma compression in journal and coredump files", \
+                        priority,                                       \
+                        "liblzma.so.5")
+#else
+#  define LIBLZMA_NOTE(priority)
+#endif
+
+#if HAVE_ZLIB
+#  define LIBZ_NOTE(priority)                                           \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        zlib,                                           \
+                        "Support gzip compression and decompression",   \
+                        priority,                                       \
+                        "libz.so.1")
+#else
+#  define LIBZ_NOTE(priority)
+#endif
+
+#if HAVE_ZSTD
+#  define LIBZSTD_NOTE(priority)                                        \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        zstd,                                           \
+                        "Support zstd compression in journal and coredump files", \
+                        priority,                                       \
+                        "libzstd.so.1")
+#else
+#  define LIBZSTD_NOTE(priority)
+#endif
+
+#define COMPRESS_NOTE(priority)                         \
+        LIBBZ2_NOTE(priority);                          \
+        LIBLZ4_NOTE(priority);                          \
+        LIBLZMA_NOTE(priority);                         \
+        LIBZ_NOTE(priority);                            \
+        LIBZSTD_NOTE(priority)
+
+#define COMPRESS_DEFAULT_NOTE                           \
+        LIBBZ2_NOTE(suggested);                         \
+        LIBLZ4_NOTE(COMPRESSION_PRIORITY_LZ4);          \
+        LIBLZMA_NOTE(COMPRESSION_PRIORITY_XZ);          \
+        LIBZ_NOTE(suggested);                           \
+        LIBZSTD_NOTE(COMPRESSION_PRIORITY_ZSTD)
index 3d8b0e65315caa772fa5a0c6aa8e9d3c1a4e2140..3453609792ea62a96aea383261dbf0d2a3663dc2 100644 (file)
@@ -1085,7 +1085,7 @@ static int install_secure_boot_auto_enroll(InstallContext *c) {
         if (!c->secure_boot_certificate || !c->secure_boot_private_key)
                 return 0;
 
-        r = DLOPEN_LIBCRYPTO(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBCRYPTO(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
index 6d9ecadcec73240d0562c7248f6c46c87d5e3e4b..4b492f77ba4858645cd4a4483360e6194e4fc372 100644 (file)
@@ -31,7 +31,7 @@ int bpf_bind_network_interface_supported(void) {
         if (supported >= 0)
                 return supported;
 
-        if (DLOPEN_BPF(LOG_WARNING, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) < 0)
+        if (DLOPEN_BPF(LOG_WARNING, recommended) < 0)
                 return (supported = false);
 
         obj = bind_iface_bpf__open();
index 5cae80a31351d9f747828c03237fd988a19c1305..33dba6d8dae43528d26f3a487e4e46ea14af0a4d 100644 (file)
@@ -78,7 +78,7 @@ bool bpf_restrict_fs_supported(bool initialize) {
         if (!initialize)
                 return false;
 
-        if (DLOPEN_BPF(LOG_WARNING, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) < 0)
+        if (DLOPEN_BPF(LOG_WARNING, recommended) < 0)
                 return (supported = false);
 
         r = lsm_supported("bpf");
index d132c34164df5868c23beb47501d66fc1cadc440..18d291795e14df22d9d7ac47313d8e11c1a7907a 100644 (file)
@@ -171,7 +171,7 @@ bool bpf_restrict_fsaccess_supported(void) {
 
         if (supported >= 0)
                 return supported;
-        if (DLOPEN_BPF(LOG_WARNING, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) < 0)
+        if (DLOPEN_BPF(LOG_WARNING, recommended) < 0)
                 return (supported = false);
 
         r = lsm_supported("bpf");
@@ -340,7 +340,7 @@ static int restrict_fsaccess_validate_deserialized_fds(Manager *m) {
 
         assert(m);
 
-        r = DLOPEN_BPF(LOG_WARNING, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_BPF(LOG_WARNING, recommended);
         if (r < 0)
                 return log_error_errno(SYNTHETIC_ERRNO(ENOTRECOVERABLE),
                                        "bpf-restrict-fsaccess: Failed to load libbpf for FD validation, aborting.");
index 9ca144a334edbc678490072f34cc820dc9844f3c..e6b32923805daf3af7796136944321d016cefb8c 100644 (file)
@@ -86,7 +86,7 @@ int bpf_restrict_ifaces_supported(void) {
         if (supported >= 0)
                 return supported;
 
-        if (DLOPEN_BPF(LOG_WARNING, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) < 0)
+        if (DLOPEN_BPF(LOG_WARNING, recommended) < 0)
                 return (supported = false);
 
         r = prepare_restrict_ifaces_bpf(NULL, true, NULL, &obj);
index 3751d624308642228ffdfd5b611a1bc6129ce557..47f0d209f75f0cd7a6cf2f981b921a45dafdfef4 100644 (file)
@@ -125,7 +125,7 @@ int bpf_socket_bind_supported(void) {
         _cleanup_(socket_bind_bpf_freep) struct socket_bind_bpf *obj = NULL;
         int r;
 
-        if (DLOPEN_BPF(LOG_WARNING, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) < 0)
+        if (DLOPEN_BPF(LOG_WARNING, recommended) < 0)
                 return false;
 
         r = prepare_socket_bind_bpf(/* unit= */ NULL, /* allow_rules= */ NULL, /* deny_rules= */ NULL, &obj);
index 7a7f7f2a709c08e318f6e1ccddcbd0f0161d4b93..b232cd015cc0ef49bb1f2a551471901709fd5db9 100644 (file)
@@ -1310,7 +1310,7 @@ static int setup_pam(
          * parent process will exec() the actual daemon. We do things this way to ensure that the main PID of
          * the daemon is the one we initially fork()ed. */
 
-        r = DLOPEN_LIBPAM(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBPAM(LOG_ERR, recommended);
         if (r < 0)
                 return r;
 
@@ -1576,7 +1576,7 @@ static bool seccomp_allows_drop_privileges(const ExecContext *c) {
         assert(c);
 
         /* No libseccomp, all is fine */
-        if (DLOPEN_LIBSECCOMP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) < 0)
+        if (DLOPEN_LIBSECCOMP(LOG_DEBUG, recommended) < 0)
                 return true;
 
         /* No syscall filter, we are allowed to drop privileges */
@@ -1886,7 +1886,7 @@ static int apply_restrict_filesystems(const ExecContext *c, const ExecParameters
         }
 
         /* We are in a new binary, so dl-open again */
-        r = DLOPEN_BPF(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_BPF(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
@@ -6000,12 +6000,12 @@ int exec_invoke(
         }
 
         /* Load a bunch of libraries we'll possibly need later, before we turn off dlopen() */
-        (void) DLOPEN_BPF(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
-        (void) DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
-        (void) DLOPEN_LIBMOUNT(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
-        (void) DLOPEN_LIBSECCOMP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        (void) DLOPEN_BPF(LOG_DEBUG, recommended);
+        (void) DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
+        (void) DLOPEN_LIBMOUNT(LOG_DEBUG, recommended);
+        (void) DLOPEN_LIBSECCOMP(LOG_DEBUG, recommended);
         /* Needed for userspace verity verification fallback */
-        (void) DLOPEN_LIBCRYPTO(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        (void) DLOPEN_LIBCRYPTO(LOG_DEBUG, recommended);
 
         /* Let's now disable further dlopen()ing of libraries, since we are about to do namespace
          * shenanigans, and do not want to mix resources from host and namespace */
index 4240e01d0be9cc3baa0ebc1776e02eb83fe7e021..f581b5c120ba1b9ee34448c46d477cb650d3c45c 100644 (file)
@@ -1575,7 +1575,7 @@ void exec_context_dump(const ExecContext *c, FILE* f, const char *prefix) {
                         fputc('~', f);
 
 #if HAVE_SECCOMP
-                if (DLOPEN_LIBSECCOMP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) >= 0) {
+                if (DLOPEN_LIBSECCOMP(LOG_DEBUG, recommended) >= 0) {
                         void *id, *val;
                         bool first = true;
                         HASHMAP_FOREACH_KEY(val, id, c->syscall_filter) {
@@ -1994,7 +1994,7 @@ char** exec_context_get_syscall_filter(const ExecContext *c) {
         assert(c);
 
 #if HAVE_SECCOMP
-        if (DLOPEN_LIBSECCOMP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) < 0)
+        if (DLOPEN_LIBSECCOMP(LOG_DEBUG, recommended) < 0)
                 return strv_new(NULL);
 
         void *id, *val;
@@ -2063,7 +2063,7 @@ char** exec_context_get_syscall_log(const ExecContext *c) {
         assert(c);
 
 #if HAVE_SECCOMP
-        if (DLOPEN_LIBSECCOMP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) < 0)
+        if (DLOPEN_LIBSECCOMP(LOG_DEBUG, recommended) < 0)
                 return strv_new(NULL);
 
         void *id, *val;
index 5c02e30880068e054b5af591d1e67a6355571502..a05715dcfce6d54dd1cb0dd05ab4ccaebf6abfce 100644 (file)
@@ -3814,7 +3814,7 @@ static int run_systemd(int argc, char *argv[]) {
         }
 
         /* Building without libmount is allowed, but if it is compiled in, then we must be able to load it */
-        r = DLOPEN_LIBMOUNT(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_LIBMOUNT(LOG_DEBUG, required);
         if (r < 0 && !ERRNO_IS_NEG_NOT_SUPPORTED(r)) {
                 error_message = "Failed to load libmount.so";
                 goto finish;
index cf2d839347b2e9a3141701dc13dc8f4e1d8438b4..45a84e635064e4ff4fd16e0ebc585cfde3a86b8a 100644 (file)
@@ -2407,7 +2407,7 @@ static int mount_test_startable(Unit *u) {
 }
 
 static bool mount_supported(void) {
-        return DLOPEN_LIBMOUNT(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) >= 0;
+        return DLOPEN_LIBMOUNT(LOG_DEBUG, recommended) >= 0;
 }
 
 static int mount_subsystem_ratelimited(Manager *m) {
index 04257d82f34cc4a4eb4f0561f58d2907dab4553c..ff9a975b08bd08a0f3b60c61e042f4615148899d 100644 (file)
@@ -3986,7 +3986,7 @@ int refresh_extensions_in_namespace(
         if (r > 0)
                 return log_debug_errno(SYNTHETIC_ERRNO(EINVAL), "Target namespace is not separate, cannot reload extensions");
 
-        (void) DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        (void) DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
 
         extension_dir = path_join(p->private_namespace_dir, "unit-extensions");
         if (!extension_dir)
index 886b00cbf564b66f8902321fc352ecbe6a03c217..fa65567ab05bb84a1fd0ad179fafb2c725df1770 100644 (file)
@@ -17,7 +17,7 @@ int mac_selinux_setup(bool *loaded_policy) {
 
         assert(loaded_policy);
 
-        r = DLOPEN_LIBSELINUX(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBSELINUX(LOG_DEBUG, recommended);
         if (r < 0)
                 return 0;
 
index 9d17e30ac1f76e4a0c92fe4e97266d83776b2e02..455b157a02c3a94706c841069e5b8b77ccf4b5bf 100644 (file)
@@ -188,7 +188,7 @@ static int is_tmpfs_with_noswap(dev_t devno) {
         _cleanup_(mnt_free_tablep) struct libmnt_table *table = NULL;
         int r;
 
-        r = DLOPEN_LIBMOUNT(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBMOUNT(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
index 77ead096731918d95c93f5ccea2304b43e6aec96..83d448dc6569e19444ef24cd99c8673514990d64 100644 (file)
@@ -344,7 +344,7 @@ static int vl_method_enroll(
         if (FLAGS_SET(flags, SD_VARLINK_METHOD_MORE))
                 c.link = sd_varlink_ref(link);
 
-        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, required);
         if (r < 0)
                 return r;
 
@@ -421,7 +421,7 @@ static int vl_method_list_slots(
         if (strdup_to(&c.node, node) < 0)
                 return -ENOMEM;
 
-        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, required);
         if (r < 0)
                 return r;
 
index 6c3ee9b039aac60ed1e1b9ea74e2d891ba60fe06..1b5bbc3016fb930701aaebd0f3a6cf1e4d156e33 100644 (file)
@@ -1036,7 +1036,7 @@ static int run(int argc, char *argv[]) {
         if (r <= 0)
                 return r;
 
-        r = DLOPEN_CRYPTSETUP(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_CRYPTSETUP(LOG_ERR, required);
         if (r < 0)
                 return r;
 
index 4cf6b7654c22a4ed6c2da68e4faaece84b71fdc0..800b297ae8470607ad6f08ecd6de41bdbe4d65df 100644 (file)
@@ -37,7 +37,7 @@ _public_ int cryptsetup_token_open_pin(
         assert(pin || pin_size == 0);
         assert(token >= 0);
 
-        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, required);
         if (r < 0)
                 return r;
 
@@ -102,7 +102,7 @@ _public_ void cryptsetup_token_dump(
 
         assert(json);
 
-        if (DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED) < 0)
+        if (DLOPEN_CRYPTSETUP(LOG_DEBUG, required) < 0)
                 return;
 
         r = parse_luks2_fido2_data(cd, json, &rp_id, &salt, &salt_size, &cid, &cid_size, &required);
@@ -169,7 +169,7 @@ _public_ int cryptsetup_token_validate(
 
         assert(json);
 
-        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, required);
         if (r < 0)
                 return r;
 
index 6952bb7ca239346f009317093cde566429220e14..483686f671e31e4983d54ade709db9e8900ff5c9 100644 (file)
@@ -36,7 +36,7 @@ _public_ int cryptsetup_token_open_pin(
         assert(pin || pin_size == 0);
         assert(token >= 0);
 
-        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, required);
         if (r < 0)
                 return r;
 
@@ -94,7 +94,7 @@ _public_ void cryptsetup_token_dump(
         _cleanup_free_ void *pkcs11_key = NULL;
         Pkcs11RsaPadding rsa_padding = PKCS11_RSA_PADDING_PKCS1V15;
 
-        if (DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED) < 0)
+        if (DLOPEN_CRYPTSETUP(LOG_DEBUG, required) < 0)
                 return;
 
         r = parse_luks2_pkcs11_data(cd, json, &pkcs11_uri, &pkcs11_key, &pkcs11_key_size, &rsa_padding);
@@ -124,7 +124,7 @@ _public_ int cryptsetup_token_validate(
         sd_json_variant *w;
         _cleanup_(sd_json_variant_unrefp) sd_json_variant *v = NULL;
 
-        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, required);
         if (r < 0)
                 return r;
 
index af2b2b74776d688d611cce4728cd9a4d3ea33ab1..dd1cb77d8c384629622a941a0a681853e63f2678 100644 (file)
@@ -70,7 +70,7 @@ _public_ int cryptsetup_token_open_pin(
         assert(ret_password);
         assert(ret_password_len);
 
-        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, required);
         if (r < 0)
                 return r;
 
@@ -210,7 +210,7 @@ _public_ void cryptsetup_token_dump(
 
         assert(json);
 
-        if (DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED) < 0)
+        if (DLOPEN_CRYPTSETUP(LOG_DEBUG, required) < 0)
                 return;
 
         r = sd_json_parse(json, SD_JSON_PARSE_MUST_BE_OBJECT, &v, /* reterr_line= */ NULL, /* reterr_column= */ NULL);
@@ -304,7 +304,7 @@ _public_ int cryptsetup_token_validate(
 
         assert(json);
 
-        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, required);
         if (r < 0)
                 return r;
 
index 36058b249d0c65316ba3840ac4e511cd8da1e374..9be25d004d740adece02fa8993b3e76c91dd7355 100644 (file)
@@ -538,7 +538,7 @@ static int parse_one_option(const char *option) {
 #if HAVE_OPENSSL
                 _cleanup_strv_free_ char **l = NULL;
 
-                r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+                r = DLOPEN_LIBCRYPTO(LOG_ERR, recommended);
                 if (r < 0)
                         return r;
 
@@ -2893,7 +2893,7 @@ static int run(int argc, char *argv[]) {
         if (r <= 0)
                 return r;
 
-        r = DLOPEN_CRYPTSETUP(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_CRYPTSETUP(LOG_ERR, required);
         if (r < 0)
                 return r;
 
index 7a82d905da2d75200e48f66cf4b896b1e81d3089..e3db8470b65d2543692bbee3e72723973b016497 100644 (file)
@@ -493,7 +493,7 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 OPTION_LONG("make-archive", NULL, "Convert the DDI to an archive file"):
-                        r = DLOPEN_LIBARCHIVE(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+                        r = DLOPEN_LIBARCHIVE(LOG_ERR, recommended);
                         if (r < 0)
                                 return r;
 
index f5a1b7b969ff01694915d6392d7425ca3d94b05e..f54266a1102a4a71f09e10ad42b25bc142de2a47 100644 (file)
@@ -33,7 +33,7 @@ static int resize_crypt_luks_device(dev_t devno, const char *fstype, dev_t main_
         uint64_t size;
         int r;
 
-        r = DLOPEN_CRYPTSETUP(LOG_WARNING, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_CRYPTSETUP(LOG_WARNING, recommended);
         if (r < 0)
                 return r;
 
index 0da671bca655d45bd673b5f21990522e4d4ff5c8..84e3ea12053d95e67b0ea84474d65f32458ba389 100644 (file)
@@ -2501,7 +2501,7 @@ static int verb_list_signing_keys(int argc, char *argv[], uintptr_t _data, void
                         /* Let's decode the PEM key to DER (so that we lose prefix/suffix), then truncate it
                          * for display reasons. */
 
-                        r = DLOPEN_LIBCRYPTO(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+                        r = DLOPEN_LIBCRYPTO(LOG_DEBUG, recommended);
                         if (r < 0)
                                 return r;
 
index 81b2e83763867b44b1d7b78d2baee372308f8d57..b949c4b8fdb686a25f574338772f09caf5c5986e 100644 (file)
@@ -1537,7 +1537,7 @@ int manager_startup(Manager *m) {
 
         assert(m);
 
-        r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_LIBCRYPTO(LOG_ERR, required);
         if (r < 0)
                 return r;
 
index 6f51f49328954430342c444ea89674c7ad75475a..6c9692ff823b53ab472e49750d7e6fef76989be4 100644 (file)
@@ -232,7 +232,7 @@ static int fscrypt_slot_try_v1(
         assert(encrypted_size > 0);
         assert(match_key_descriptor);
 
-        r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBCRYPTO(LOG_ERR, recommended);
         if (r < 0)
                 return r;
 
@@ -331,7 +331,7 @@ static int fscrypt_slot_try_v2(
         assert(iovec_is_set(tag));
         assert(match_key_descriptor);
 
-        r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBCRYPTO(LOG_ERR, recommended);
         if (r < 0)
                 return r;
 
@@ -700,7 +700,7 @@ static int fscrypt_slot_set(
         size_t encrypted_size;
         ssize_t ss;
 
-        r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBCRYPTO(LOG_ERR, recommended);
         if (r < 0)
                 return r;
 
@@ -813,7 +813,7 @@ int home_create_fscrypt(
         assert(setup);
         assert(ret_home);
 
-        r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBCRYPTO(LOG_ERR, recommended);
         if (r < 0)
                 return r;
 
index 4a56551b9cf47d46e110b26e90d10ad39911a6be..7b9bd0d71a531fb1456be64e629f97dc69aa88e6 100644 (file)
@@ -146,7 +146,7 @@ static int probe_file_system_by_fd(
         assert(ret_fstype);
         assert(ret_uuid);
 
-        r = DLOPEN_LIBBLKID(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBBLKID(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
@@ -529,7 +529,7 @@ static int acquire_open_luks_device(
         assert(setup);
         assert(!setup->crypt_device);
 
-        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
@@ -684,7 +684,7 @@ static int luks_validate(
         assert(ret_size);
         assert(sector_size > 0);
 
-        r = DLOPEN_LIBBLKID(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBBLKID(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
@@ -805,7 +805,7 @@ static int crypt_device_to_evp_cipher(struct crypt_device *cd, const EVP_CIPHER
         assert(cd);
         assert(ret);
 
-        r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBCRYPTO(LOG_ERR, recommended);
         if (r < 0)
                 return r;
 
@@ -1293,7 +1293,7 @@ int home_setup_luks(
         assert(setup);
         assert(user_record_storage(h) == USER_LUKS);
 
-        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
@@ -1594,7 +1594,7 @@ int home_activate_luks(
         assert(setup);
         assert(ret_home);
 
-        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
@@ -2211,11 +2211,11 @@ int home_create_luks(
         assert(setup->image_fd < 0);
         assert(ret_home);
 
-        r = DLOPEN_FDISK(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_FDISK(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
-        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
@@ -3250,11 +3250,11 @@ int home_resize_luks(
         assert(user_record_storage(h) == USER_LUKS);
         assert(setup);
 
-        r = DLOPEN_FDISK(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_FDISK(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
-        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
@@ -3712,7 +3712,7 @@ int home_passwd_luks(
         assert(user_record_storage(h) == USER_LUKS);
         assert(setup);
 
-        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
index a5fca5a11884d7353a73f9acd39cce26c74f2ee6..81775e887261c1b13d586d3e74af87e0f6dc861d 100644 (file)
@@ -1328,7 +1328,7 @@ static int determine_default_storage(UserStorage *ret) {
                         if (r < 0)
                                 log_warning_errno(r, "Failed to determine if %s is encrypted, ignoring: %m", get_home_root());
 
-                        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+                        r = DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
                         if (r < 0)
                                 log_info("Not using '%s' storage, since libcryptsetup could not be loaded.", user_storage_to_string(USER_LUKS));
                         else {
index bbfee76f070f1b860817b7831ab4229a934fef67..c9a6a6ab289620209ebafccde2d7e7145266a1af 100644 (file)
@@ -786,7 +786,7 @@ _public_ PAM_EXTERN int pam_sm_authenticate(
         bool debug = false;
         int r;
 
-        r = DLOPEN_LIBPAM(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_LIBPAM(LOG_DEBUG, required);
         if (r < 0)
                 return PAM_SERVICE_ERR;
 
@@ -851,7 +851,7 @@ _public_ PAM_EXTERN int pam_sm_open_session(
         bool debug = false;
         int r;
 
-        r = DLOPEN_LIBPAM(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_LIBPAM(LOG_DEBUG, required);
         if (r < 0)
                 return PAM_SERVICE_ERR;
 
@@ -908,7 +908,7 @@ _public_ PAM_EXTERN int pam_sm_close_session(
         bool debug = false;
         int r;
 
-        r = DLOPEN_LIBPAM(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_LIBPAM(LOG_DEBUG, required);
         if (r < 0)
                 return PAM_SERVICE_ERR;
 
@@ -973,7 +973,7 @@ _public_ PAM_EXTERN int pam_sm_acct_mgmt(
         usec_t t;
         int r;
 
-        r = DLOPEN_LIBPAM(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_LIBPAM(LOG_DEBUG, required);
         if (r < 0)
                 return PAM_SERVICE_ERR;
 
@@ -1092,7 +1092,7 @@ _public_ PAM_EXTERN int pam_sm_chauthtok(
         bool debug = false;
         int r;
 
-        r = DLOPEN_LIBPAM(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_LIBPAM(LOG_DEBUG, required);
         if (r < 0)
                 return PAM_SERVICE_ERR;
 
index ea079fdbd274721b729beb3f873e848a34a0bd49..6eb1048034133a95c13458dfd16b201dbe4cb8c2 100644 (file)
@@ -3053,7 +3053,7 @@ static int run(int argc, char* argv[]) {
         if (r <= 0)
                 return r;
 
-        r = DLOPEN_CURL(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_CURL(LOG_DEBUG, required);
         if (r < 0)
                 return r;
 
index c7465147c46b8483daca535fc45757e977b5630e..41e945f1fb72949360a0aceb8847bda4ea4810d8 100644 (file)
@@ -32,7 +32,7 @@ int import_fork_tar_x(int tree_fd, int userns_fd, PidRef *ret_pid) {
         assert(tree_fd >= 0);
         assert(ret_pid);
 
-        r = DLOPEN_LIBARCHIVE(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBARCHIVE(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
@@ -99,7 +99,7 @@ int import_fork_tar_c(int tree_fd, int userns_fd, PidRef *ret_pid) {
         assert(tree_fd >= 0);
         assert(ret_pid);
 
-        r = DLOPEN_LIBARCHIVE(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBARCHIVE(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
index 119bb7528617d58ed4e1bb4ea908f179e7e828cd..d86c47039fba8578a3e0c0fb0abe17ed641e57aa 100644 (file)
@@ -281,7 +281,7 @@ static int pull_job_open_disk(PullJob *j) {
         }
 
         if (j->calc_checksum) {
-                r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+                r = DLOPEN_LIBCRYPTO(LOG_ERR, recommended);
                 if (r < 0)
                         return r;
 
index 619c3b10db50d1ea55c362e371714ee6aa0d5623..f29fcda0ab58e165a1728eb0709e6aabb5799c69 100644 (file)
@@ -204,7 +204,7 @@ static int run(int argc, char *argv[]) {
 
         log_setup();
 
-        r = DLOPEN_CRYPTSETUP(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_CRYPTSETUP(LOG_ERR, required);
         if (r < 0)
                 return r;
 
index 25465507208d940257905b12474ea2f8cd417d89..a6ef7c77fa0c42a573c3f959d8201ac4a605ec6a 100644 (file)
@@ -1265,7 +1265,7 @@ static int run(int argc, char *argv[]) {
         if (r <= 0)
                 return r;
 
-        r = DLOPEN_MICROHTTPD(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_MICROHTTPD(LOG_ERR, required);
         if (r < 0)
                 return r;
 
index 44b169c5919343f354fa755ee670169f9f2eb3a5..ff283a2ea569154300b379348b497f3e4a41c59d 100644 (file)
@@ -468,7 +468,7 @@ static int setup_microhttpd_server(RemoteServer *s,
 #if HAVE_MICROHTTPD
         int r;
 
-        r = DLOPEN_MICROHTTPD(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_MICROHTTPD(LOG_ERR, required);
         if (r < 0)
                 return r;
 
index 2eb47d21300d234dcddb2598c9b79d0d13d3b8d8..a24f577c892fd80f971feca75eecc6e57bc57ecc 100644 (file)
@@ -879,7 +879,7 @@ static int run(int argc, char **argv) {
         if (r <= 0)
                 return r;
 
-        r = DLOPEN_CURL(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_CURL(LOG_DEBUG, required);
         if (r < 0)
                 return r;
 
index 73c1579b88fed90eeaa2fcbad2a1963879b5a68b..180291ce34edbc4aa8cfbe25cfcc6ae2322d1ecf 100644 (file)
@@ -70,7 +70,7 @@ int action_setup_keys(void) {
 
         assert(arg_action == ACTION_SETUP_KEYS);
 
-        r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBCRYPTO(LOG_ERR, recommended);
         if (r < 0)
                 return r;
 
index 9fa706e1bc437922f8f9e31cc7ebb3e5ec7be72a..4915e9c95dc3ced6d666a00ddf5d117d64dc143f 100644 (file)
@@ -233,7 +233,7 @@ static int verb_extract_public(int argc, char *argv[], uintptr_t _data, void *us
                                 return r;
                 }
 
-                r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+                r = DLOPEN_LIBCRYPTO(LOG_ERR, required);
                 if (r < 0)
                         return r;
 
index 181d14dd17cc89f7c4560fde7530364d4b92dc7c..55ff67588e9c9da9b44a1620c86e587d2f272b8d 100644 (file)
@@ -1,8 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include "sd-dlopen.h"
-
 #include "dlfcn-util.h"
+#include "dlopen-note.h"
 #include "log.h"
 #include "string-util.h"
 #include "xkbcommon-util.h"
@@ -17,10 +16,7 @@ DLSYM_PROTOTYPE(xkb_keymap_unref) = NULL;
 static int dlopen_xkbcommon(int log_level) {
         static void *xkbcommon_dl = NULL;
 
-        SD_ELF_NOTE_DLOPEN(
-                        "xkbcommon",
-                        "Support for keyboard locale descriptions",
-                        SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED, "libxkbcommon.so.0");
+        LIBXKBCOMMON_NOTE(suggested);
 
         return dlopen_many_sym_or_warn(
                         &xkbcommon_dl, "libxkbcommon.so.0", log_level,
index 06d19607b2f9c738cc347196f0ed49cc3699dbd3..fa603ba015f80603878a9329e0c970094b465087 100644 (file)
@@ -1807,7 +1807,7 @@ _public_ PAM_EXTERN int pam_sm_open_session(
 
         assert(pamh);
 
-        r = DLOPEN_LIBPAM(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_LIBPAM(LOG_DEBUG, required);
         if (r < 0)
                 return PAM_SERVICE_ERR;
 
@@ -1915,7 +1915,7 @@ _public_ PAM_EXTERN int pam_sm_close_session(
 
         assert(pamh);
 
-        r = DLOPEN_LIBPAM(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_LIBPAM(LOG_DEBUG, required);
         if (r < 0)
                 return PAM_SERVICE_ERR;
 
index c93dedf5ea88d832b0861a35625928becec214c8..ee17e650a7926db0ff5025e4809b36ad471f9bbe 100644 (file)
@@ -19,7 +19,7 @@ _public_ PAM_EXTERN int pam_sm_authenticate(
 
         assert(pamh);
 
-        r = DLOPEN_LIBPAM(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_LIBPAM(LOG_DEBUG, required);
         if (r < 0)
                 return PAM_SERVICE_ERR;
 
index 0e5762a682b56e32759d1fcb976256c2d51ec67d..893fd4e593a852bdec4fb0def081b63d30f446a9 100644 (file)
@@ -178,7 +178,7 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) {
                             "Select TPM bank (SHA1, SHA256, SHA384, SHA512)"): {
                         const EVP_MD *implementation;
 
-                        r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+                        r = DLOPEN_LIBCRYPTO(LOG_ERR, required);
                         if (r < 0)
                                 return r;
 
@@ -1137,7 +1137,7 @@ static int run(int argc, char *argv[]) {
         if (r <= 0)
                 return r;
 
-        r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_LIBCRYPTO(LOG_ERR, required);
         if (r < 0)
                 return r;
 
index ab4c03609a2bf0fcf13089af819f90b33a96754f..7d12360fa8409b0dc566e9c0506d7083fc2a533b 100644 (file)
@@ -108,7 +108,7 @@ int manager_install_sysctl_monitor(Manager *manager) {
 
         assert(manager);
 
-        r = DLOPEN_BPF(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_BPF(LOG_DEBUG, recommended);
         if (ERRNO_IS_NEG_NOT_SUPPORTED(r))
                 return log_debug_errno(r, "sysctl monitor disabled, as BPF support is not available.");
         if (r < 0)
index 0f206bd7067c6d85abd71d1f871b69bf8de8bba6..3e4fd4685604b4426b9dba0800ca467906ba7f0b 100644 (file)
@@ -1826,7 +1826,7 @@ static int oci_seccomp(const char *name, sd_json_variant *v, sd_json_dispatch_fl
         if (r < 0)
                 return json_log(def, flags, r, "Unknown default action: %s", sd_json_variant_string(def));
 
-        r = DLOPEN_LIBSECCOMP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBSECCOMP(LOG_DEBUG, recommended);
         if (r < 0)
                 return json_log(def, flags, r, "No support for libseccomp: %m");
 
index add7c9146b1c87af425eae938904f4a4ae600ba3..c4dfc9584ec950d198bc85b3ad6e8006cb0fc651 100644 (file)
@@ -6141,9 +6141,9 @@ static int run(int argc, char *argv[]) {
         if (arg_cleanup)
                 return do_cleanup();
 
-        (void) DLOPEN_LIBMOUNT(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
-        (void) DLOPEN_LIBSECCOMP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
-        (void) DLOPEN_LIBSELINUX(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        (void) DLOPEN_LIBMOUNT(LOG_DEBUG, recommended);
+        (void) DLOPEN_LIBSECCOMP(LOG_DEBUG, recommended);
+        (void) DLOPEN_LIBSELINUX(LOG_DEBUG, recommended);
 
         r = cg_has_legacy();
         if (r < 0)
index 1b82c797f09ee45b80d86c2effdba37a560c4611..dc2ab9b67e5db2f7740a6f25e5169021cbfed757 100644 (file)
@@ -68,7 +68,7 @@ int userns_restrict_install(
         if (r == 0)
                 return log_error_errno(SYNTHETIC_ERRNO(EOPNOTSUPP), "bpf-lsm not supported, can't lock down user namespace.");
 
-        r = DLOPEN_BPF(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_BPF(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
index 782f863272627ac0403bfd5fb6b30fe79a6174b2..ab212600dfd74c9dd0ea550b7831f37b12ea4db8 100644 (file)
@@ -90,7 +90,7 @@ static int parse_argv(int argc, char *argv[], char ***ret_args) {
                 OPTION_LONG("bank", "DIGEST", "Select TPM PCR bank (SHA1, SHA256)"): {
                         const EVP_MD *implementation;
 
-                        r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+                        r = DLOPEN_LIBCRYPTO(LOG_ERR, required);
                         if (r < 0)
                                 return r;
 
index a1bc5c2bea351a72b9cdae7b3efc7b04129a0b75..d51215d522a010f6ac21dd5beac56c43e5e2755a 100644 (file)
@@ -5709,7 +5709,7 @@ static int run(int argc, char *argv[]) {
         if (r <= 0)
                 return r;
 
-        r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_LIBCRYPTO(LOG_ERR, required);
         if (r < 0)
                 return r;
 
index 2b398ec07566df942cc9ab5ac586bae8992e1a2a..6779ddd5514f4dea87727d63dc89f3401df385e1 100644 (file)
@@ -610,8 +610,8 @@ static int portable_extract_by_path(
                  * there, and extract the metadata we need. The metadata is sent from the child back to us. */
 
                 /* Load some libraries before we fork workers off that want to use them */
-                (void) DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
-                (void) DLOPEN_LIBMOUNT(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+                (void) DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
+                (void) DLOPEN_LIBMOUNT(LOG_DEBUG, required);
 
                 r = mkdtemp_malloc("/tmp/inspect-XXXXXX", &tmpdir);
                 if (r < 0)
index e0e494a6f2964efe00c20982957a12068ad3e1d1..099b901226d5297545e7cc5386e4648b39e14186 100644 (file)
@@ -3120,7 +3120,7 @@ static int partition_read_definition(
                                   "Cannot format %s filesystem without source files, refusing.", p->format);
 
         if (p->verity != VERITY_OFF || p->encrypt != ENCRYPT_OFF) {
-                r = DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+                r = DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
                 if (r < 0)
                         return log_syntax(NULL, LOG_ERR, path, 1, r,
                                           "libcryptsetup not found, Verity=/Encrypt= are not supported: %m");
@@ -4739,7 +4739,7 @@ static int context_wipe_range(Context *context, uint64_t offset, uint64_t size)
         assert(offset != UINT64_MAX);
         assert(size != UINT64_MAX);
 
-        r = DLOPEN_LIBBLKID(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_LIBBLKID(LOG_ERR, required);
         if (r < 0)
                 return r;
 
@@ -5431,7 +5431,7 @@ static int partition_encrypt(Context *context, Partition *p, PartitionTarget *ta
         assert(p);
         assert(p->encrypt != ENCRYPT_OFF);
 
-        r = DLOPEN_CRYPTSETUP(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_CRYPTSETUP(LOG_ERR, recommended);
         if (r < 0)
                 return r;
 
@@ -5973,7 +5973,7 @@ static int partition_format_verity_hash(
 
         (void) partition_hint(p, node, &hint);
 
-        r = DLOPEN_CRYPTSETUP(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_CRYPTSETUP(LOG_ERR, recommended);
         if (r < 0)
                 return r;
 
@@ -6075,7 +6075,7 @@ static int sign_verity_roothash(
         assert(iovec_is_set(roothash));
         assert(ret_signature);
 
-        r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBCRYPTO(LOG_ERR, recommended);
         if (r < 0)
                 return r;
 
@@ -7167,7 +7167,7 @@ static int partition_populate_filesystem(Context *context, Partition *p, const c
          * appear in the host namespace. Hence we fork a child that has its own file system namespace and
          * detached mount propagation. */
 
-        (void) DLOPEN_LIBMOUNT(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        (void) DLOPEN_LIBMOUNT(LOG_DEBUG, required);
 
         r = pidref_safe_fork(
                         "(sd-copy)",
@@ -8798,7 +8798,7 @@ static int resolve_copy_blocks_auto_candidate(
                 return log_error_errno(r, "Failed to open block device " DEVNUM_FORMAT_STR ": %m",
                                        DEVNUM_FORMAT_VAL(whole_devno));
 
-        r = DLOPEN_LIBBLKID(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_LIBBLKID(LOG_ERR, required);
         if (r < 0)
                 return r;
 
@@ -11620,7 +11620,7 @@ static int run(int argc, char *argv[]) {
         if (r <= 0)
                 return r;
 
-        r = DLOPEN_FDISK(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_FDISK(LOG_ERR, required);
         if (r < 0)
                 return r;
 
index 6aca27810c7ee507352be04daa1f69d9298d3104..41b342cad63f0a09c1758c8fa789c9e5e62839b0 100644 (file)
@@ -304,7 +304,7 @@ static int vl_server(void) {
         _cleanup_(sd_varlink_server_unrefp) sd_varlink_server *vs = NULL;
         int r;
 
-        r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_LIBCRYPTO(LOG_ERR, required);
         if (r < 0)
                 return r;
 
index e21c0044e63a5dd589b09b4c69e1337f57f64a29..01981c3ecf45f35cab496e24c8f1c9020ab8d4a3 100644 (file)
@@ -64,7 +64,7 @@ static int http_upload_report(Context *context, sd_json_variant *report) {
         char error[CURL_ERROR_SIZE] = {};
         int r;
 
-        r = DLOPEN_CURL(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_CURL(LOG_DEBUG, required);
         if (r < 0)
                 return r;
 
index 575f100809d04802b879715ef99defdad51c27c4..c8821f189c6075812afc562c4090731ed2a1def8 100644 (file)
@@ -735,7 +735,7 @@ int dnssec_verify_rrset(
         assert(dnskey);
         assert(result);
 
-        r = DLOPEN_LIBCRYPTO(LOG_WARNING, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBCRYPTO(LOG_WARNING, recommended);
         if (r < 0)
                 return r;
 
@@ -1092,7 +1092,7 @@ int dnssec_verify_dnskey_by_ds(DnsResourceRecord *dnskey, DnsResourceRecord *ds,
         assert(dnskey);
         assert(ds);
 
-        r = DLOPEN_LIBCRYPTO(LOG_WARNING, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBCRYPTO(LOG_WARNING, recommended);
         if (r < 0)
                 return r;
 
@@ -1232,7 +1232,7 @@ int dnssec_nsec3_hash(DnsResourceRecord *nsec3, const char *name, void *ret) {
         assert(name);
         assert(ret);
 
-        r = DLOPEN_LIBCRYPTO(LOG_WARNING, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBCRYPTO(LOG_WARNING, recommended);
         if (r < 0)
                 return r;
 
index f39e0447c2190f40fdf34efb7c4a0bdc1fc5fcde..a8d823af1e56b64c00a42b9da96c24e1dae0fcd5 100644 (file)
@@ -412,11 +412,11 @@ int dnstls_manager_init(Manager *manager) {
         if (manager->dnstls_data.ctx)
                 return 0;
 
-        r = DLOPEN_LIBCRYPTO(LOG_WARNING, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBCRYPTO(LOG_WARNING, recommended);
         if (r < 0)
                 return r;
 
-        r = DLOPEN_LIBSSL(LOG_WARNING, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBSSL(LOG_WARNING, recommended);
         if (r < 0)
                 return r;
 
index 7b591ebbb90688805527d0058df3f3dec7565b43..6fd6c049f914a8e313270497ebbc1ba9556440d7 100644 (file)
@@ -36,7 +36,7 @@ int resolve_system_hostname(char **full_hostname, char **first_label) {
 #if HAVE_LIBIDN2
         _cleanup_free_ char *utf8 = NULL;
 
-        if (DLOPEN_IDN(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED) >= 0) {
+        if (DLOPEN_IDN(LOG_DEBUG, recommended) >= 0) {
                 r = sym_idn2_to_unicode_8z8z(label, &utf8, 0);
                 if (r != IDN2_OK)
                         return log_debug_errno(SYNTHETIC_ERRNO(EUCLEAN),
index e7a519404c8a8308b4584c699b45a9cae1d3cdb2..0d86f8544f326b0e8f4b1a10373bbc7b793f2833 100644 (file)
@@ -406,7 +406,7 @@ static int verb_sign(int argc, char *argv[], uintptr_t _data, void *userdata) {
         _cleanup_(iovec_done) struct iovec signed_attributes_signature = {};
         int r;
 
-        r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_LIBCRYPTO(LOG_ERR, required);
         if (r < 0)
                 return r;
 
index 84fca4da0e444b81b4cc0bdc2572937634969252..68457e1636756b4002401f2fab87adefe0cee67f 100644 (file)
@@ -3,8 +3,6 @@
 #include <sys/stat.h>
 #include <sys/syslog.h>
 
-#include "sd-dlopen.h"
-
 #include "acl-util.h"
 #include "alloc-util.h"
 #include "errno-util.h"
@@ -49,7 +47,7 @@ int dlopen_libacl(int log_level) {
 #if HAVE_ACL
         static void *libacl_dl = NULL;
 
-        LIBACL_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        LIBACL_NOTE(recommended);
 
         return dlopen_many_sym_or_warn(
                         &libacl_dl,
index 2b9ac817366536e33a33dc499a03680e6b86e852..c06900008d78f988b08b7908df6d6ea609d376d2 100644 (file)
@@ -1,8 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-dlopen.h"
-
+#include "dlopen-note.h"
 #include "shared-forward.h"
 
 #if HAVE_ACL
@@ -66,17 +65,6 @@ static inline int acl_set_perm(acl_permset_t ps, acl_perm_t p, bool b) {
         return (b ? sym_acl_add_perm : sym_acl_delete_perm)(ps, p);
 }
 
-#define LIBACL_NOTE(priority)                                           \
-        SD_ELF_NOTE_DLOPEN("acl",                                       \
-                           "Support for file Access Control Lists (ACLs)", \
-                           priority,                                    \
-                           "libacl.so.1")
-
-#define DLOPEN_LIBACL(log_level, priority)                              \
-        ({                                                              \
-                LIBACL_NOTE(priority);                                  \
-                dlopen_libacl(log_level);                               \
-        })
 #else
 
 typedef void* acl_t;
@@ -107,12 +95,16 @@ static inline int devnode_acl(int fd, const Set *uids) {
 static inline int fd_add_uid_acl_permission(int fd, uid_t uid, unsigned mask) {
         return -EOPNOTSUPP;
 }
-
-#define DLOPEN_LIBACL(log_level, priority) dlopen_libacl(log_level)
 #endif
 
 int dlopen_libacl(int log_level);
 
+#define DLOPEN_LIBACL(log_level, priority)                              \
+        ({                                                              \
+                LIBACL_NOTE(priority);                                  \
+                dlopen_libacl(log_level);                               \
+        })
+
 int fd_acl_make_read_only(int fd);
 int fd_acl_make_writable(int fd);
 
index c2e874553e3ecebfab8a98ee41e3ef79eaeb52f0..a2b3179c90e33699649149e61a567b036a3e9f0d 100644 (file)
@@ -1,14 +1,13 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include "apparmor-util.h"
+#include "dlopen-note.h"
 #include "log.h"
 
 #if HAVE_APPARMOR
 
 #include <syslog.h>
 
-#include "sd-dlopen.h"
-
 #include "fileio.h"
 
 DLSYM_PROTOTYPE(aa_change_onexec) = NULL;
@@ -48,11 +47,7 @@ int dlopen_libapparmor(int log_level) {
 #if HAVE_APPARMOR
         static void *libapparmor_dl = NULL;
 
-        SD_ELF_NOTE_DLOPEN(
-                        "apparmor",
-                        "Support for AppArmor policies",
-                        SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
-                        "libapparmor.so.1");
+        LIBAPPARMOR_NOTE(recommended);
 
         return dlopen_many_sym_or_warn(
                         &libapparmor_dl,
index 233d45c4f0c876b3f7a94604cf188255afa49a2d..98648917f1289b09165535b0b858e8ce04b0b009 100644 (file)
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include "sd-dlopen.h"
 #include "sd-id128.h"
 
 #include "blkid-util.h"
@@ -99,7 +98,7 @@ int dlopen_libblkid(int log_level) {
 #if HAVE_BLKID
         static void *libblkid_dl = NULL;
 
-        LIBBLKID_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        LIBBLKID_NOTE(recommended);
 
         return dlopen_many_sym_or_warn(
                         &libblkid_dl,
index 97356477fadfa60ef2731490afd54f680b329b76..91f6e9c8c29b51eb410c7526f99cd49229c4e5ef 100644 (file)
@@ -1,8 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-dlopen.h"
-
+#include "dlopen-note.h"
 #include "shared-forward.h"
 
 #if HAVE_BLKID
@@ -68,20 +67,12 @@ enum {
 
 int blkid_probe_lookup_value_id128(blkid_probe b, const char *field, sd_id128_t *ret);
 int blkid_probe_lookup_value_u64(blkid_probe b, const char *field, uint64_t *ret);
+#endif
 
-#define LIBBLKID_NOTE(priority)                                         \
-        SD_ELF_NOTE_DLOPEN("blkid",                                     \
-                           "Support for block device identification",   \
-                           priority,                                    \
-                           "libblkid.so.1")
+int dlopen_libblkid(int log_level);
 
 #define DLOPEN_LIBBLKID(log_level, priority)                            \
         ({                                                              \
                 LIBBLKID_NOTE(priority);                                \
                 dlopen_libblkid(log_level);                             \
         })
-#else
-#define DLOPEN_LIBBLKID(log_level, priority) dlopen_libblkid(log_level)
-#endif
-
-int dlopen_libblkid(int log_level);
index 6cd4069580a1f3a1c79252a4adef524ba4550cff..ebfc9b30bb1ed6fc70bdcc346b3e2d9564328f18 100644 (file)
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include "sd-dlopen.h"
-
 #include "bpf-util.h"
 #include "dlfcn-util.h"
 #include "initrd-util.h"
@@ -90,7 +88,7 @@ int dlopen_bpf(int log_level) {
         if (cached < 0)
                 return cached; /* Already tried, and failed. */
 
-        BPF_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED);
+        LIBBPF_NOTE(suggested);
 
         DISABLE_WARNING_DEPRECATED_DECLARATIONS;
 
index 6c2e7a2c98e439d03e060a4df31b9fe2eda21dc9..88ef204af0ec9e5441d78d71b9cb500135f92f9b 100644 (file)
@@ -3,7 +3,8 @@
 
 #include <syslog.h>
 
-#include "sd-dlopen.h"
+#include "dlopen-note.h"
+#include "shared-forward.h"
 
 #if HAVE_LIBBPF
 #ifndef SYSTEMD_CFLAGS_MARKER_LIBBPF
@@ -14,7 +15,6 @@
 #include <bpf/libbpf.h> /* IWYU pragma: export */
 
 #include "dlfcn-util.h"
-#include "shared-forward.h"
 
 /* Always redeclare these so DLSYM_PROTOTYPE's typeof() resolves regardless of libbpf version;
  * suppress the warning when the libbpf headers already declare them.
@@ -92,20 +92,12 @@ static inline int compat_bpf_map_create(
  * this helper instead of libbpf_get_error() to ensure some of the known ones are translated into errnos
  * we understand. */
 int bpf_get_error_translated(const void *ptr);
+#endif
 
-#define BPF_NOTE(priority)                                              \
-        SD_ELF_NOTE_DLOPEN("bpf",                                       \
-                           "Support firewalling and sandboxing with BPF", \
-                           priority,                                    \
-                           "libbpf.so.1", "libbpf.so.0")
+int dlopen_bpf(int log_level);
 
 #define DLOPEN_BPF(log_level, priority)                                 \
         ({                                                              \
-                BPF_NOTE(priority);                                     \
+                LIBBPF_NOTE(priority);                                  \
                 dlopen_bpf(log_level);                                  \
         })
-#else
-#define DLOPEN_BPF(log_level, priority) dlopen_bpf(log_level)
-#endif
-
-int dlopen_bpf(int log_level);
index d791996efc7a2e03976e9c22ab906e6525a23709..d285c16b8b3d38dea30d36fb7bc93e8ab2b7ff4f 100644 (file)
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include "sd-dlopen.h"
-
 #include "alloc-util.h"
 #include "ask-password-api.h"
 #include "crypto-util.h"
@@ -348,7 +346,7 @@ int dlopen_libcrypto(int log_level) {
         static void *libcrypto_dl = NULL;
         int r;
 
-        LIBCRYPTO_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED);
+        LIBCRYPTO_NOTE(suggested);
 
         FOREACH_STRING(soname, "libcrypto.so.4", "libcrypto.so.3") {
                 r = dlopen_many_sym_or_warn(
index 9927dfb5c7bc3ec273040d7221e283232ae4fd27..f4bf7ed49ed37df310dbd6d37fabde263952e41f 100644 (file)
@@ -1,11 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-dlopen.h"
-
-#include "shared-forward.h"
+#include "dlopen-note.h"
 #include "iovec-util.h"
 #include "sha256.h"
+#include "shared-forward.h"
 
 typedef enum CertificateSourceType {
         OPENSSL_CERTIFICATE_SOURCE_FILE,
@@ -28,8 +27,6 @@ int parse_openssl_certificate_source_argument(const char *argument, char **certi
 
 int parse_openssl_key_source_argument(const char *argument, char **private_key_source, KeySourceType *private_key_source_type);
 
-int dlopen_libcrypto(int log_level);
-
 #define X509_FINGERPRINT_SIZE SHA256_DIGEST_SIZE
 
 #if HAVE_OPENSSL
@@ -37,18 +34,6 @@ int dlopen_libcrypto(int log_level);
 #  error "missing libopenssl_cflags in meson dependency."
 #endif
 
-#define LIBCRYPTO_NOTE(priority)                                        \
-        SD_ELF_NOTE_DLOPEN("libcrypto",                                 \
-                           "Support for cryptographic operations",      \
-                           priority,                                    \
-                           "libcrypto.so.4", "libcrypto.so.3")
-
-#define DLOPEN_LIBCRYPTO(log_level, priority)                           \
-        ({                                                              \
-                LIBCRYPTO_NOTE(priority);                               \
-                dlopen_libcrypto(log_level);                            \
-        })
-
 #  include <openssl/bio.h>              /* IWYU pragma: export */
 #  include <openssl/bn.h>               /* IWYU pragma: export */
 #  include <openssl/core_names.h>       /* IWYU pragma: export */
@@ -459,7 +444,12 @@ int openssl_extract_public_key(EVP_PKEY *private_key, EVP_PKEY **ret);
 
 OpenSSLAskPasswordUI* openssl_ask_password_ui_free(OpenSSLAskPasswordUI *ui);
 DEFINE_TRIVIAL_CLEANUP_FUNC_FULL(OpenSSLAskPasswordUI*, openssl_ask_password_ui_free, NULL);
-
-#else
-#define DLOPEN_LIBCRYPTO(log_level, priority) dlopen_libcrypto(log_level)
 #endif
+
+int dlopen_libcrypto(int log_level);
+
+#define DLOPEN_LIBCRYPTO(log_level, priority)                           \
+        ({                                                              \
+                LIBCRYPTO_NOTE(priority);                               \
+                dlopen_libcrypto(log_level);                            \
+        })
index 531d2fcbc017915193331c08a988003e8135c4d1..7c6d6468a9d1adabdb70b8df7a0ae7816f7eadea 100644 (file)
@@ -2,7 +2,6 @@
 
 #include <stdlib.h>
 
-#include "sd-dlopen.h"
 #include "sd-json.h"
 
 #include "alloc-util.h"
@@ -282,7 +281,7 @@ int dlopen_cryptsetup(int log_level) {
          * still available though, and given we want to support 2.2.0 for a while longer, we'll use the old
          * symbol if the new one is not available. */
 
-        CRYPTSETUP_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED);
+        LIBCRYPTSETUP_NOTE(suggested);
 
         r = dlopen_many_sym_or_warn(
                         &cryptsetup_dl, "libcryptsetup.so.12", log_level,
index 1c1e122e753e662cbbdad10dfcefa975281256aa..b1eb3b724e34c0df8d59ef5b3d64062d3855dd29 100644 (file)
@@ -1,9 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-dlopen.h"
-
 #include "dlfcn-util.h"
+#include "dlopen-note.h"
 #include "shared-forward.h"
 
 #if HAVE_LIBCRYPTSETUP
@@ -98,23 +97,15 @@ int cryptsetup_add_token_json(struct crypt_device *cd, sd_json_variant *v);
 int cryptsetup_get_volume_key_prefix(struct crypt_device *cd, const char *volume_name, char **ret);
 int cryptsetup_get_volume_key_id(struct crypt_device *cd, const char *volume_name, const void *volume_key,
                                  size_t volume_key_size,  char **ret);
+#endif
 
-#define CRYPTSETUP_NOTE(priority)                                       \
-        SD_ELF_NOTE_DLOPEN("cryptsetup",                                \
-                           "Support for disk encryption, integrity, and authentication", \
-                           priority,                                    \
-                           "libcryptsetup.so.12")
+int dlopen_cryptsetup(int log_level);
 
 #define DLOPEN_CRYPTSETUP(log_level, priority)                          \
         ({                                                              \
-                CRYPTSETUP_NOTE(priority);                              \
+                LIBCRYPTSETUP_NOTE(priority);                           \
                 dlopen_cryptsetup(log_level);                           \
         })
-#else
-#define DLOPEN_CRYPTSETUP(log_level, priority) dlopen_cryptsetup(log_level)
-#endif
-
-int dlopen_cryptsetup(int log_level);
 
 int cryptsetup_get_keyslot_from_token(sd_json_variant *v);
 
index 961a97ad2f79564729a5443db9ef0b36310e953f..186b77454bf6d897d4cb9ea876e995354df20aff 100644 (file)
@@ -5,7 +5,6 @@
 
 #if HAVE_LIBCURL
 
-#include "sd-dlopen.h"
 #include "sd-event.h"
 
 #include "alloc-util.h"
@@ -604,7 +603,7 @@ int dlopen_curl(int log_level) {
 #if HAVE_LIBCURL
         static void *curl_dl = NULL;
 
-        CURL_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED);
+        LIBCURL_NOTE(suggested);
 
         return dlopen_many_sym_or_warn(
                         &curl_dl,
index a010cefac104628ba4e781f612e3859fa8f6bdbe..20f54aae59d92b210d4cc7ec381cf9bbc236dad3 100644 (file)
@@ -1,8 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-dlopen.h"
-
+#include "dlopen-note.h"
 #include "shared-forward.h"
 
 #if HAVE_LIBCURL
@@ -76,20 +75,12 @@ int curl_append_to_header(struct curl_slist **list, char **headers);
 
 DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(CURL*, sym_curl_easy_cleanup, curl_easy_cleanupp, NULL);
 DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct curl_slist*, sym_curl_slist_free_all, curl_slist_free_allp, NULL);
+#endif
 
-#define CURL_NOTE(priority)                                             \
-        SD_ELF_NOTE_DLOPEN("curl",                                      \
-                           "Support for downloading and uploading files over HTTP", \
-                           priority,                                    \
-                           "libcurl.so.4")
+int dlopen_curl(int log_level);
 
 #define DLOPEN_CURL(log_level, priority)                                \
         ({                                                              \
-                CURL_NOTE(priority);                                    \
+                LIBCURL_NOTE(priority);                                 \
                 dlopen_curl(log_level);                                 \
         })
-#else
-#define DLOPEN_CURL(log_level, priority) dlopen_curl(log_level)
-#endif
-
-int dlopen_curl(int log_level);
diff --git a/src/shared/dlopen-note.h b/src/shared/dlopen-note.h
new file mode 100644 (file)
index 0000000..b1ed14e
--- /dev/null
@@ -0,0 +1,381 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "../basic/dlopen-note.h"       /* IWYU pragma: export */
+#include "shared-forward.h"
+
+#if HAVE_ACL
+#  define LIBACL_NOTE(priority)                                         \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        acl,                                            \
+                        "Support for file Access Control Lists (ACLs)", \
+                        priority,                                       \
+                        "libacl.so.1")
+#else
+#  define LIBACL_NOTE(priority)
+#endif
+
+#if HAVE_APPARMOR
+#  define LIBAPPARMOR_NOTE(priority)                                    \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        apparmor,                                       \
+                        "Support for AppArmor policies",                \
+                        priority,                                       \
+                        "libapparmor.so.1")
+#else
+#  define LIBAPPARMOR_NOTE(priority)
+#endif
+
+#if HAVE_LIBARCHIVE
+#  define LIBARCHIVE_NOTE(priority)                                     \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        archive,                                        \
+                        "Support for decompressing archive files",      \
+                        priority,                                       \
+                        "libarchive.so.13")
+#else
+#  define LIBARCHIVE_NOTE(priority)
+#endif
+
+#if HAVE_AUDIT
+#  define LIBAUDIT_NOTE(priority)                     \
+        ELF_NOTE_DLOPEN_ANCHORED(                     \
+                        audit,                        \
+                        "Support for Audit logging",  \
+                        priority,                     \
+                        "libaudit.so.1")
+#else
+#  define LIBAUDIT_NOTE(priority)
+#endif
+
+#if HAVE_BLKID
+#  define LIBBLKID_NOTE(priority)                                       \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        blkid,                                          \
+                        "Support for block device identification",      \
+                        priority,                                       \
+                        "libblkid.so.1")
+#else
+#  define LIBBLKID_NOTE(priority)
+#endif
+
+#if HAVE_LIBBPF
+#  define LIBBPF_NOTE(priority)                                         \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        bpf,                                            \
+                        "Support firewalling and sandboxing with BPF",  \
+                        priority,                                       \
+                        "libbpf.so.1", "libbpf.so.0")
+#else
+#  define LIBBPF_NOTE(priority)
+#endif
+
+#if HAVE_LIBCRYPT && defined(__GLIBC__)
+#  define LIBCRYPT_NOTE(priority)                                       \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        crypt,                                          \
+                        "Support for hashing passwords",                \
+                        priority,                                       \
+                        "libcrypt.so.2", "libcrypt.so.1", "libcrypt.so.1.1")
+#else
+#  define LIBCRYPT_NOTE(priority)
+#endif
+
+#if HAVE_OPENSSL
+#  define LIBCRYPTO_NOTE(priority)                                      \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        libcrypto,                                      \
+                        "Support for cryptographic operations",         \
+                        priority,                                       \
+                        "libcrypto.so.4", "libcrypto.so.3")
+#else
+#  define LIBCRYPTO_NOTE(priority)
+#endif
+
+#if HAVE_LIBCRYPTSETUP
+#  define LIBCRYPTSETUP_NOTE(priority)                                  \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        cryptsetup,                                     \
+                        "Support for disk encryption, integrity, and authentication", \
+                        priority,                                       \
+                        "libcryptsetup.so.12")
+#else
+#  define LIBCRYPTSETUP_NOTE(priority)
+#endif
+
+#if HAVE_LIBCURL
+#  define LIBCURL_NOTE(priority)                                        \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        curl,                                           \
+                        "Support for downloading and uploading files over HTTP", \
+                        priority,                                       \
+                        "libcurl.so.4")
+#else
+#  define LIBCURL_NOTE(priority)
+#endif
+
+#if HAVE_LIBFDISK
+#  define LIBFDISK_NOTE(priority)                                       \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        fdisk,                                          \
+                        "Support for reading and writing partition tables", \
+                        priority,                                       \
+                        "libfdisk.so.1")
+#else
+#  define LIBFDISK_NOTE(priority)
+#endif
+
+#if HAVE_ELFUTILS
+#  define LIBDW_NOTE(priority)                                          \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        dw,                                             \
+                        "Support for backtrace and ELF package metadata decoding from core files", \
+                        priority,                                       \
+                        "libdw.so.1")
+#else
+#  define LIBDW_NOTE(priority)
+#endif
+
+#if HAVE_ELFUTILS
+#  define LIBELF_NOTE(priority)                                         \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        elf,                                            \
+                        "Support for backtraces and reading ELF package metadata from core files", \
+                        priority,                                       \
+                        "libelf.so.1")
+#else
+#  define LIBELF_NOTE(priority)
+#endif
+
+#if HAVE_LIBFIDO2
+#  define LIBFIDO2_NOTE(priority)                                       \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        fido2,                                          \
+                        "Support fido2 for encryption and authentication", \
+                        priority,                                       \
+                        "libfido2.so.1")
+#else
+#  define LIBFIDO2_NOTE(priority)
+#endif
+
+#if HAVE_GNUTLS
+#  define LIBGNUTLS_NOTE(priority)                              \
+        ELF_NOTE_DLOPEN_ANCHORED(                               \
+                        gnutls,                                 \
+                        "Support for TLS via GnuTLS",           \
+                        priority,                               \
+                        "libgnutls.so.30")
+#else
+#  define LIBGNUTLS_NOTE(priority)
+#endif
+
+#if HAVE_LIBIDN2
+#  define LIBIDN2_NOTE(priority)                                        \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        idn,                                            \
+                        "Support for internationalized domain names",   \
+                        priority,                                       \
+                        "libidn2.so.0")
+#else
+#  define LIBIDN2_NOTE(priority)
+#endif
+
+#if HAVE_KMOD
+#  define LIBKMOD_NOTE(priority)                                        \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        kmod,                                           \
+                        "Support for loading kernel modules",           \
+                        priority,                                       \
+                        "libkmod.so.2")
+#else
+#  define LIBKMOD_NOTE(priority)
+#endif
+
+#if HAVE_MICROHTTPD
+#  define LIBMICROHTTPD_NOTE(priority)                                  \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        microhttpd,                                     \
+                        "Support for embedded HTTP server via libmicrohttpd", \
+                        priority,                                       \
+                        "libmicrohttpd.so.12")
+#else
+#  define LIBMICROHTTPD_NOTE(priority)
+#endif
+
+#if HAVE_LIBMOUNT
+#  define LIBMOUNT_NOTE(priority)                                       \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        mount,                                          \
+                        "Support for mount enumeration",                \
+                        priority,                                       \
+                        "libmount.so.1")
+#else
+#  define LIBMOUNT_NOTE(priority)
+#endif
+
+#if HAVE_P11KIT
+#  define LIBP11KIT_NOTE(priority)                                 \
+        SD_ELF_NOTE_DLOPEN_ANCHORED(                               \
+                        p11kit_##priority,                         \
+                        "p11-kit",                                 \
+                        "Support for PKCS11 hardware tokens",      \
+                        STRINGIFY(priority),                       \
+                        "libp11-kit.so.0")
+#else
+#  define LIBP11KIT_NOTE(priority)
+#endif
+
+#if HAVE_PAM
+#  define LIBPAM_NOTE(priority)                                         \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        pam,                                            \
+                        "Support for LinuxPAM",                         \
+                        priority,                                       \
+                        "libpam.so.0")
+#else
+#  define LIBPAM_NOTE(priority)
+#endif
+
+#if HAVE_PASSWDQC
+#  define LIBPASSWDQC_NOTE(priority)                            \
+        ELF_NOTE_DLOPEN_ANCHORED(                               \
+                        passwdqc,                               \
+                        "Support for password quality checks",  \
+                        priority,                               \
+                        "libpasswdqc.so.1")
+#else
+#  define LIBPASSWDQC_NOTE(priority)
+#endif
+
+#if HAVE_PCRE2
+#  define LIBPCRE2_NOTE(priority)                               \
+        ELF_NOTE_DLOPEN_ANCHORED(                               \
+                        pcre2,                                  \
+                        "Support for regular expressions",      \
+                        priority,                               \
+                        "libpcre2-8.so.0")
+#else
+#  define LIBPCRE2_NOTE(priority)
+#endif
+
+#if HAVE_PWQUALITY
+#  define LIBPWQUALITY_NOTE(priority)                           \
+        ELF_NOTE_DLOPEN_ANCHORED(                               \
+                        pwquality,                              \
+                        "Support for password quality checks",  \
+                        priority,                               \
+                        "libpwquality.so.1")
+#else
+#  define LIBPWQUALITY_NOTE(priority)
+#endif
+
+#if HAVE_QRENCODE
+#  define LIBQRENCODE_NOTE(priority)                            \
+        ELF_NOTE_DLOPEN_ANCHORED(                               \
+                        qrencode,                               \
+                        "Support for generating QR codes",      \
+                        priority,                               \
+                        "libqrencode.so.4", "libqrencode.so.3")
+#else
+#  define LIBQRENCODE_NOTE(priority)
+#endif
+
+#if HAVE_SECCOMP
+#  define LIBSECCOMP_NOTE(priority)                                     \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        seccomp,                                        \
+                        "Support for Seccomp Sandboxes",                \
+                        priority,                                       \
+                        "libseccomp.so.2")
+#else
+#  define LIBSECCOMP_NOTE(priority)
+#endif
+
+#if HAVE_SELINUX
+#  define LIBSELINUX_NOTE(priority)                                     \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        selinux,                                        \
+                        "Support for SELinux",                          \
+                        priority,                                       \
+                        "libselinux.so.1")
+#else
+#  define LIBSELINUX_NOTE(priority)
+#endif
+
+#if HAVE_OPENSSL
+#  define LIBSSL_NOTE(priority)                                         \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        libssl,                                         \
+                        "Support for TLS",                              \
+                        priority,                                       \
+                        "libssl.so.4", "libssl.so.3")
+#else
+#  define LIBSSL_NOTE(priority)
+#endif
+
+#if HAVE_TPM2
+#  define LIBTSS2_ESYS_NOTE(priority)           \
+        SD_ELF_NOTE_DLOPEN_ANCHORED(            \
+                        tpm2_esys_##priority,   \
+                        "tpm",                  \
+                        "Support for TPM",      \
+                        STRINGIFY(priority),    \
+                        "libtss2-esys.so.0")
+#  define LIBTSS2_RC_NOTE(priority)             \
+        SD_ELF_NOTE_DLOPEN_ANCHORED(            \
+                        tpm2_rc_##priority,     \
+                        "tpm",                  \
+                        "Support for TPM",      \
+                        STRINGIFY(priority),    \
+                        "libtss2-rc.so.0")
+#  define LIBTSS2_MU_NOTE(priority)               \
+        SD_ELF_NOTE_DLOPEN_ANCHORED(              \
+                        tpm2_mu_##priority,       \
+                        "tpm",                    \
+                        "Support for TPM",        \
+                        STRINGIFY(priority),      \
+                        "libtss2-mu.so.0")
+#  define LIBTSS2_TCTI_DEVICE_NOTE(priority)            \
+        SD_ELF_NOTE_DLOPEN_ANCHORED(                    \
+                        tpm2_tcti_device_##priority,    \
+                        "tpm",                          \
+                        "Support for TPM",              \
+                        STRINGIFY(priority),            \
+                        "libtss2-tcti-device.so.0")
+#else
+#  define LIBTSS2_ESYS_NOTE(priority)
+#  define LIBTSS2_RC_NOTE(priority)
+#  define LIBTSS2_MU_NOTE(priority)
+#  define LIBTSS2_TCTI_DEVICE_NOTE(priority)
+#endif
+
+#if HAVE_XKBCOMMON
+#  define LIBXKBCOMMON_NOTE(priority)                                   \
+        ELF_NOTE_DLOPEN_ANCHORED(                                       \
+                        xkbcommon,                                      \
+                        "Support for keyboard locale descriptions",     \
+                        priority,                                       \
+                        "libxkbcommon.so.0")
+#else
+#  define LIBXKBCOMMON_NOTE(priority)
+#endif
+
+#if HAVE_LIBARCHIVE
+#  define ARCHIVE_NOTE(priority)                \
+        COMPRESS_NOTE(priority);                \
+        LIBACL_NOTE(priority);                  \
+        LIBARCHIVE_NOTE(priority)
+#else
+#  define ARCHIVE_NOTE(priority)                \
+        COMPRESS_NOTE(priority)
+#endif
+
+#define PASSWORD_NOTE(priority)                 \
+        LIBPASSWDQC_NOTE(priority);             \
+        LIBPWQUALITY_NOTE(priority)
+
+#define TPM2_NOTE(priority)                                             \
+        LIBTSS2_ESYS_NOTE(priority);                                    \
+        LIBTSS2_RC_NOTE(priority);                                      \
+        LIBTSS2_MU_NOTE(priority);                                      \
+        LIBTSS2_TCTI_DEVICE_NOTE(priority)
index 5e40541ffcf9bc56b61120735fdc9190ba033470..9a926e49ed3ee0cde5569cbde8fc270c444ecadd 100644 (file)
 #endif
 #include <unistd.h>
 
-#include "sd-dlopen.h"
 #include "sd-json.h"
 
 #include "alloc-util.h"
 #include "coredump-util.h"
 #include "dlfcn-util.h"
+#include "dlopen-note.h"
 #include "elf-util.h"
 #include "errno-util.h"
 #include "escape.h"
@@ -100,11 +100,7 @@ int dlopen_dw(int log_level) {
         static void *dw_dl = NULL;
         int r;
 
-        SD_ELF_NOTE_DLOPEN(
-                        "dw",
-                        "Support for backtrace and ELF package metadata decoding from core files",
-                        SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
-                        "libdw.so.1");
+        LIBDW_NOTE(suggested);
 
         r = dlopen_many_sym_or_warn(
                         &dw_dl, "libdw.so.1", log_level,
@@ -166,11 +162,7 @@ int dlopen_elf(int log_level) {
         static void *elf_dl = NULL;
         int r;
 
-        SD_ELF_NOTE_DLOPEN(
-                        "elf",
-                        "Support for backtraces and reading ELF package metadata from core files",
-                        SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
-                        "libelf.so.1");
+        LIBELF_NOTE(suggested);
 
         r = dlopen_many_sym_or_warn(
                         &elf_dl, "libelf.so.1", log_level,
index 8efafbc96e469cfb703f81aee13d75e3d9989398..3c56f7033f66f66c3533ce12bc1f13fa1394d915 100644 (file)
@@ -5,8 +5,6 @@
 
 #if HAVE_LIBFDISK
 
-#include "sd-dlopen.h"
-
 #include "alloc-util.h"
 #include "bitfield.h"
 #include "dissect-image.h"
@@ -83,7 +81,7 @@ int dlopen_fdisk(int log_level) {
 #if HAVE_LIBFDISK
         static void *fdisk_dl = NULL;
 
-        FDISK_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED);
+        LIBFDISK_NOTE(suggested);
 
         return dlopen_many_sym_or_warn(
                         &fdisk_dl,
index acdbd7c741cdee34436e3d66c9df0b2621b4fc4e..c34cde1a41e7ec4504fc3d546f447905cc378b58 100644 (file)
@@ -1,8 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-dlopen.h"
-
+#include "dlopen-note.h"
 #include "shared-forward.h"
 
 #if HAVE_LIBFDISK
@@ -88,20 +87,12 @@ int fdisk_partition_get_type_as_id128(struct fdisk_partition *p, sd_id128_t *ret
 
 int fdisk_partition_get_attrs_as_uint64(struct fdisk_partition *pa, uint64_t *ret);
 int fdisk_partition_set_attrs_as_uint64(struct fdisk_partition *pa, uint64_t flags);
+#endif
 
-#define FDISK_NOTE(priority)                                            \
-        SD_ELF_NOTE_DLOPEN("fdisk",                                     \
-                           "Support for reading and writing partition tables", \
-                           priority,                                    \
-                           "libfdisk.so.1")
+int dlopen_fdisk(int log_level);
 
 #define DLOPEN_FDISK(log_level, priority)                               \
         ({                                                              \
-                FDISK_NOTE(priority);                                   \
+                LIBFDISK_NOTE(priority);                                \
                 dlopen_fdisk(log_level);                                \
         })
-#else
-#define DLOPEN_FDISK(log_level, priority) dlopen_fdisk(log_level)
-#endif
-
-int dlopen_fdisk(int log_level);
index 4a13dbe1ec9cdc1896e4c40a19ecfa7a5ef1d33b..96460f1e02dfec64b10a5fa77066b2c2a47b2f21 100644 (file)
@@ -1,7 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include "sd-dlopen.h"
-
+#include "dlopen-note.h"
 #include "gnutls-util.h"
 #include "log.h"                /* IWYU pragma: keep */
 
@@ -23,11 +22,7 @@ int dlopen_gnutls(int log_level) {
 #if HAVE_GNUTLS
         static void *gnutls_dl = NULL;
 
-        SD_ELF_NOTE_DLOPEN(
-                        "gnutls",
-                        "Support for TLS via GnuTLS",
-                        SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
-                        "libgnutls.so.30");
+        LIBGNUTLS_NOTE(suggested);
 
         return dlopen_many_sym_or_warn(
                         &gnutls_dl,
index 01c808b57feadaebd985fb6bbc9a437e37e4bca8..fe36b71d3c8e83ea5b71219a53653fda8fa5dcfb 100644 (file)
@@ -5,8 +5,6 @@
 
 #if HAVE_LIBIDN2
 
-#include "sd-dlopen.h"
-
 static void* idn_dl = NULL;
 
 DLSYM_PROTOTYPE(idn2_lookup_u8) = NULL;
@@ -17,7 +15,7 @@ DLSYM_PROTOTYPE(idn2_to_unicode_8z8z) = NULL;
 
 int dlopen_idn(int log_level) {
 #if HAVE_LIBIDN2
-        IDN_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED);
+        LIBIDN2_NOTE(suggested);
 
         return dlopen_many_sym_or_warn(
                         &idn_dl, "libidn2.so.0", log_level,
index 0f3db74c63289f2fc03e06381cdfa0fce780c1b3..cf7e8a861789e9d752ff179ccf6a68136f930163 100644 (file)
@@ -1,8 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-dlopen.h"
-
+#include "dlopen-note.h"
 #include "shared-forward.h"
 
 #if HAVE_LIBIDN2
 extern DLSYM_PROTOTYPE(idn2_lookup_u8);
 extern const char *(*sym_idn2_strerror)(int rc) _const_;
 extern DLSYM_PROTOTYPE(idn2_to_unicode_8z8z);
+#endif
 
-#define IDN_NOTE(priority)                                              \
-        SD_ELF_NOTE_DLOPEN("idn",                                       \
-                           "Support for internationalized domain names", \
-                           priority,                                    \
-                           "libidn2.so.0")
+int dlopen_idn(int log_level);
 
 #define DLOPEN_IDN(log_level, priority)                                 \
         ({                                                              \
-                IDN_NOTE(priority);                                     \
+                LIBIDN2_NOTE(priority);                                 \
                 dlopen_idn(log_level);                                  \
         })
-#else
-#define DLOPEN_IDN(log_level, priority) dlopen_idn(log_level)
-#endif
-
-int dlopen_idn(int log_level);
index cc28c2d3471f20f0d033f09a58e71a9d67220264..1e66fd68ca2115cf6e25c1813635ba5efd08a70a 100644 (file)
@@ -2,8 +2,6 @@
 
 #include <syslog.h>
 
-#include "sd-dlopen.h"
-
 #include "libarchive-util.h"
 #include "log.h"                        /* IWYU pragma: keep */
 #include "user-util.h"                  /* IWYU pragma: keep */
@@ -80,7 +78,7 @@ int dlopen_libarchive(int log_level) {
         static void *libarchive_dl = NULL;
         int r;
 
-        LIBARCHIVE_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED);
+        LIBARCHIVE_NOTE(suggested);
 
         r = dlopen_many_sym_or_warn(
                         &libarchive_dl,
index 71b4d66d42ce2215d99d579b8797fcd902e17956..775ede55b978a8cb41e9b08bf4cae5fe58dde28f 100644 (file)
@@ -1,8 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-dlopen.h"
-
+#include "dlopen-note.h"
 #include "shared-forward.h"
 
 #if HAVE_LIBARCHIVE
@@ -84,21 +83,12 @@ extern DLSYM_PROTOTYPE(archive_write_set_format_pax);
 DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct archive_entry*, sym_archive_entry_free, archive_entry_freep, NULL);
 DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct archive*, sym_archive_write_free, archive_write_freep, NULL);
 DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct archive*, sym_archive_read_free, archive_read_freep, NULL);
+#endif
 
-#define LIBARCHIVE_NOTE(priority)                                       \
-        SD_ELF_NOTE_DLOPEN("archive",                                   \
-                           "Support for decompressing archive files",   \
-                           priority,                                    \
-                           "libarchive.so.13")
+int dlopen_libarchive(int log_level);
 
 #define DLOPEN_LIBARCHIVE(log_level, priority)                          \
         ({                                                              \
                 LIBARCHIVE_NOTE(priority);                              \
                 dlopen_libarchive(log_level);                           \
         })
-
-#else
-#define DLOPEN_LIBARCHIVE(log_level, priority) dlopen_libarchive(log_level)
-#endif
-
-int dlopen_libarchive(int log_level);
index 41daa372b5874027cfcb00ce249433ca560adfbf..481eda7294e72ebfc1c0e5df55726ea1c6c441f7 100644 (file)
@@ -4,8 +4,7 @@
 #include <linux/netlink.h>
 #include <sys/socket.h>
 
-#include "sd-dlopen.h"
-
+#include "dlopen-note.h"
 #include "errno-util.h"
 #include "fd-util.h"
 #include "iovec-util.h"
@@ -25,11 +24,7 @@ int dlopen_libaudit(int log_level) {
 #if HAVE_AUDIT
         static void *libaudit_dl = NULL;
 
-        SD_ELF_NOTE_DLOPEN(
-                        "audit",
-                        "Support for Audit logging",
-                        SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
-                        "libaudit.so.1");
+        LIBAUDIT_NOTE(recommended);
 
         return dlopen_many_sym_or_warn(
                         &libaudit_dl,
index 106d7688fe958cfaa0c2d6497c5056e88836e009..0a72e4e25a2283f9785564095e2368482be10e9f 100644 (file)
@@ -7,10 +7,9 @@
 #  include <crypt.h>
 #endif
 
-#include "sd-dlopen.h"
-
 #include "alloc-util.h"
 #include "dlfcn-util.h"
+#include "dlopen-note.h"
 #include "errno-util.h"
 #include "libcrypt-util.h"
 #include "log.h"
@@ -144,15 +143,11 @@ int dlopen_libcrypt(int log_level) {
         if (cached < 0)
                 return cached; /* Already tried, and failed. */
 
+        LIBCRYPT_NOTE(recommended);
+
         /* Several distributions like Debian/Ubuntu and OpenSUSE provide libxcrypt as libcrypt.so.1
          * (libcrypt.so.1.1 on some architectures), while others like Fedora/CentOS and Arch provide it as
          * libcrypt.so.2. */
-        SD_ELF_NOTE_DLOPEN(
-                        "crypt",
-                        "Support for hashing passwords",
-                        SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED,
-                        "libcrypt.so.2", "libcrypt.so.1", "libcrypt.so.1.1");
-
         FOREACH_STRING(soname, "libcrypt.so.2", "libcrypt.so.1", "libcrypt.so.1.1") {
                 r = dlopen_many_sym_or_warn(
                                 &libcrypt_dl, soname, LOG_DEBUG,
index 07bea6658ec45ac9b7679d0fd6ccbbd270243fd7..0276e639533873246e284a23d20708f214a040c4 100644 (file)
@@ -1,7 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include "sd-dlopen.h"
-
+#include "dlopen-note.h"
 #include "libfido2-util.h"
 #include "log.h"
 
@@ -86,11 +85,7 @@ int dlopen_libfido2(int log_level) {
         static void *libfido2_dl = NULL;
         int r;
 
-        SD_ELF_NOTE_DLOPEN(
-                        "fido2",
-                        "Support fido2 for encryption and authentication",
-                        SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
-                        "libfido2.so.1");
+        LIBFIDO2_NOTE(suggested);
 
         r = dlopen_many_sym_or_warn(
                         &libfido2_dl, "libfido2.so.1", log_level,
index fd83da136ff3d629b0a9875676e4cd01527432b6..39fef6974d641f4a2d26b552dbc76cf06565a2a5 100644 (file)
@@ -7,8 +7,6 @@
 
 #include <stdio.h>
 
-#include "sd-dlopen.h"
-
 #include "fstab-util.h"
 
 DLSYM_PROTOTYPE(mnt_free_iter) = NULL;
@@ -120,7 +118,7 @@ int dlopen_libmount(int log_level) {
 #if HAVE_LIBMOUNT
         static void *libmount_dl = NULL;
 
-        LIBMOUNT_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        LIBMOUNT_NOTE(recommended);
 
         return dlopen_many_sym_or_warn(
                         &libmount_dl,
index 3afdb9737885a0a4f414a41d1b945195768bc5a5..20195a13c8b8dc642d2e7319e80248df91c68df2 100644 (file)
@@ -1,8 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-dlopen.h"
-
+#include "dlopen-note.h"
 #include "shared-forward.h"
 
 #if HAVE_LIBMOUNT
@@ -78,28 +77,21 @@ int libmount_is_leaf(
                 struct libmnt_table *table,
                 struct libmnt_fs *fs);
 
-#define LIBMOUNT_NOTE(priority)                                         \
-        SD_ELF_NOTE_DLOPEN("mount",                                     \
-                           "Support for mount enumeration",             \
-                           priority,                                    \
-                           "libmount.so.1")
-
-#define DLOPEN_LIBMOUNT(log_level, priority)                            \
-        ({                                                              \
-                LIBMOUNT_NOTE(priority);                                \
-                dlopen_libmount(log_level);                             \
-        })
 #else
 
 struct libmnt_monitor;
 
-
 static inline void* sym_mnt_unref_monitor(struct libmnt_monitor *p) {
         assert(p == NULL);
         return NULL;
 }
 
-#define DLOPEN_LIBMOUNT(log_level, priority) dlopen_libmount(log_level)
 #endif
 
 int dlopen_libmount(int log_level);
+
+#define DLOPEN_LIBMOUNT(log_level, priority)                            \
+        ({                                                              \
+                LIBMOUNT_NOTE(priority);                                \
+                dlopen_libmount(log_level);                             \
+        })
index 9820a1e400015b92bf759416b3c10d37c530a95c..4a43bb65f514f650314fbec48afb8a315dc156cb 100644 (file)
@@ -2,8 +2,6 @@
 
 #include <stdio.h>
 
-#include "sd-dlopen.h"
-
 #include "alloc-util.h"
 #include "gnutls-util.h"
 #include "log.h"
@@ -36,7 +34,7 @@ int dlopen_microhttpd(int log_level) {
 #if HAVE_MICROHTTPD
         static void *microhttpd_dl = NULL;
 
-        MICROHTTPD_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED);
+        LIBMICROHTTPD_NOTE(suggested);
 
         return dlopen_many_sym_or_warn(
                         &microhttpd_dl,
index c430f9e3d1a26a178a5095caa5bd1ee09f47a611..524d73b8a2532a64bd4183cceae4edb4ce5d94b7 100644 (file)
@@ -1,29 +1,14 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-dlopen.h"
-
+#include "dlopen-note.h"
 #include "shared-forward.h"
 
-int dlopen_microhttpd(int log_level);
-
 #if HAVE_MICROHTTPD
 #ifndef SYSTEMD_CFLAGS_MARKER_LIBMICROHTTPD
 #  error "missing libmicrohttpd_cflags in meson dependency."
 #endif
 
-#define MICROHTTPD_NOTE(priority)                                       \
-        SD_ELF_NOTE_DLOPEN("microhttpd",                                \
-                           "Support for embedded HTTP server via libmicrohttpd", \
-                           priority,                                    \
-                           "libmicrohttpd.so.12")
-
-#define DLOPEN_MICROHTTPD(log_level, priority)                          \
-        ({                                                              \
-                MICROHTTPD_NOTE(priority);                              \
-                dlopen_microhttpd(log_level);                           \
-        })
-
 #include <microhttpd.h>
 
 #include "dlfcn-util.h"
@@ -150,7 +135,12 @@ int setup_gnutls_logger(char **categories);
 
 DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct MHD_Daemon*, sym_MHD_stop_daemon, MHD_stop_daemonp, NULL);
 DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct MHD_Response*, sym_MHD_destroy_response, MHD_destroy_responsep, NULL);
-
-#else
-#define DLOPEN_MICROHTTPD(log_level, priority) dlopen_microhttpd(log_level)
 #endif
+
+int dlopen_microhttpd(int log_level);
+
+#define DLOPEN_MICROHTTPD(log_level, priority)                          \
+        ({                                                              \
+                LIBMICROHTTPD_NOTE(priority);                           \
+                dlopen_microhttpd(log_level);                           \
+        })
index e060c69d9d6752d19650179d28f9d88b87a4af79..33704449d9a2244e68b032983b967ea7a26406c3 100644 (file)
@@ -2,8 +2,6 @@
 
 #include <syslog.h>
 
-#include "sd-dlopen.h"
-
 #include "log.h"
 #include "module-util.h"
 #include "proc-cmdline.h"
@@ -173,7 +171,7 @@ int dlopen_libkmod(int log_level) {
 #if HAVE_KMOD
         static void *libkmod_dl = NULL;
 
-        LIBKMOD_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        LIBKMOD_NOTE(recommended);
 
         return dlopen_many_sym_or_warn(
                         &libkmod_dl,
index 59d2f3b1f1e0713b49182fd4e8165de4dc022ee1..59b13d01cfceabbc91203a3f701d3cd2be7ead6c 100644 (file)
@@ -1,8 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-dlopen.h"
-
+#include "dlopen-note.h"
 #include "shared-forward.h"
 
 #if HAVE_KMOD
@@ -40,22 +39,10 @@ DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(struct kmod_list*, sym_kmod_module_unref
 int module_load_and_warn(struct kmod_ctx *ctx, const char *module, bool verbose);
 int module_setup_context(struct kmod_ctx **ret);
 
-#define LIBKMOD_NOTE(priority)                                          \
-        SD_ELF_NOTE_DLOPEN("kmod",                                      \
-                           "Support for loading kernel modules",        \
-                           priority,                                    \
-                           "libkmod.so.2")
-
-#define DLOPEN_LIBKMOD(log_level, priority)                             \
-        ({                                                              \
-                LIBKMOD_NOTE(priority);                                 \
-                dlopen_libkmod(log_level);                              \
-        })
 #else
 
 struct kmod_ctx;
 
-
 static inline int module_setup_context(struct kmod_ctx **ret) {
         return -EOPNOTSUPP;
 }
@@ -64,7 +51,12 @@ static inline int module_load_and_warn(struct kmod_ctx *ctx, const char *module,
         return -EOPNOTSUPP;
 }
 
-#define DLOPEN_LIBKMOD(log_level, priority) dlopen_libkmod(log_level)
 #endif
 
 int dlopen_libkmod(int log_level);
+
+#define DLOPEN_LIBKMOD(log_level, priority)                             \
+        ({                                                              \
+                LIBKMOD_NOTE(priority);                                 \
+                dlopen_libkmod(log_level);                              \
+        })
index 0fe4207a0b7a1be97dbee8d850dbbf221032aca0..8d3a7b8d3ecc7c6fba72e99c7bd3d8f844c58848 100644 (file)
@@ -9,7 +9,6 @@
 #include <syslog.h>
 
 #include "sd-bus.h"
-#include "sd-dlopen.h"
 
 #include "alloc-util.h"
 #include "bus-internal.h"
@@ -383,7 +382,7 @@ int dlopen_libpam(int log_level) {
 #if HAVE_PAM
         static void *libpam_dl = NULL;
 
-        LIBPAM_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        LIBPAM_NOTE(recommended);
 
         return dlopen_many_sym_or_warn(
                         &libpam_dl,
index 41591a4d36cfc216157a5ad6319112226982d6c5..5f23667102db99364aee9b3f0976cf43c4165a67 100644 (file)
@@ -1,8 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-dlopen.h"
-
+#include "dlopen-note.h"
 #include "shared-forward.h"
 
 #if HAVE_PAM
@@ -109,20 +108,12 @@ int pam_prompt_graceful(pam_handle_t *pamh, int style, char **ret_response, cons
 /* Equivalent of pam_misc_setenv(pamh, name, value, 0), without the libpam_misc dep â€” builds "name=value"
  * and hands it to sym_pam_putenv(), then erases the buffer before freeing in case it carried a secret. */
 int pam_putenv_assign(pam_handle_t *pamh, const char *name, const char *value);
+#endif
 
-#define LIBPAM_NOTE(priority)                                           \
-        SD_ELF_NOTE_DLOPEN("pam",                                       \
-                           "Support for LinuxPAM",                      \
-                           priority,                                    \
-                           "libpam.so.0")
+int dlopen_libpam(int log_level);
 
 #define DLOPEN_LIBPAM(log_level, priority)                              \
         ({                                                              \
                 LIBPAM_NOTE(priority);                                  \
                 dlopen_libpam(log_level);                               \
         })
-#else
-#define DLOPEN_LIBPAM(log_level, priority) dlopen_libpam(log_level)
-#endif
-
-int dlopen_libpam(int log_level);
index 8d762f7e5cc6d823928755afc7935e6824f6789e..15d95b76de0c9ee49ece9fa01b54685a4593be1f 100644 (file)
@@ -1,9 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include "password-quality-util-passwdqc.h"
-
+#include "dlopen-note.h"
 #include "errno-util.h"          /* IWYU pragma: keep */
 #include "log.h"                 /* IWYU pragma: keep */
+#include "password-quality-util-passwdqc.h"
 
 #if HAVE_PASSWDQC
 #ifndef SYSTEMD_CFLAGS_MARKER_LIBPWQUALITY
@@ -12,8 +12,6 @@
 
 #include <passwdqc.h>
 
-#include "sd-dlopen.h"
-
 #include "alloc-util.h"
 #include "dlfcn-util.h"
 #include "memory-util.h"
@@ -143,11 +141,7 @@ int dlopen_passwdqc(int log_level) {
 #if HAVE_PASSWDQC
         static void *passwdqc_dl = NULL;
 
-        SD_ELF_NOTE_DLOPEN(
-                        "passwdqc",
-                        "Support for password quality checks",
-                        SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
-                        "libpasswdqc.so.1");
+        LIBPASSWDQC_NOTE(suggested);
 
         return dlopen_many_sym_or_warn(
                         &passwdqc_dl, "libpasswdqc.so.1", log_level,
index 9952c4d195b2791984dd13625f3c24807c3cf860..e045a43a77c00c322b3bff6d679ea01fd63a816c 100644 (file)
@@ -1,9 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include "password-quality-util-pwquality.h"
-
+#include "dlopen-note.h"
 #include "errno-util.h"
 #include "log.h"
+#include "password-quality-util-pwquality.h"
 
 #if HAVE_PWQUALITY
 #ifndef SYSTEMD_CFLAGS_MARKER_LIBPWQUALITY
@@ -14,8 +14,6 @@
 #include <stdio.h>
 #include <unistd.h>
 
-#include "sd-dlopen.h"
-
 #include "alloc-util.h"
 #include "dlfcn-util.h"
 #include "password-quality-util.h"
@@ -159,11 +157,7 @@ int dlopen_pwquality(int log_level) {
 #if HAVE_PWQUALITY
         static void *pwquality_dl = NULL;
 
-        SD_ELF_NOTE_DLOPEN(
-                        "pwquality",
-                        "Support for password quality checks",
-                        SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
-                        "libpwquality.so.1");
+        LIBPWQUALITY_NOTE(suggested);
 
         return dlopen_many_sym_or_warn(
                         &pwquality_dl, "libpwquality.so.1", log_level,
index 52b65a95a35f397e4b9a22389612dea7c0d224f2..0523612bd9baccd9fa22d1c82741974538f44dbd 100644 (file)
@@ -1,8 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include "sd-dlopen.h"
-
 #include "dlfcn-util.h"
+#include "dlopen-note.h"
 #include "hash-funcs.h"
 #include "log.h"
 #include "pcre2-util.h"
@@ -30,11 +29,7 @@ int dlopen_pcre2(int log_level) {
 #if HAVE_PCRE2
         static void *pcre2_dl = NULL;
 
-        SD_ELF_NOTE_DLOPEN(
-                        "pcre2",
-                        "Support for regular expressions",
-                        SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
-                        "libpcre2-8.so.0");
+        LIBPCRE2_NOTE(suggested);
 
         /* So here's something weird: PCRE2 actually renames the symbols exported by the library via C
          * macros, so that the exported symbols carry a suffix "_8" but when used from C the suffix is
index 6002c2e0af73d2d3945567d7fcc6a0ade27884e7..a9bf1e5913f70a71144da7675fce741c6ac31c4c 100644 (file)
@@ -1,11 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include "sd-dlopen.h"
-
 #include "alloc-util.h"
 #include "ask-password-api.h"
 #include "crypto-util.h"
 #include "dlfcn-util.h"
+#include "dlopen-note.h"
 #include "env-util.h"
 #include "escape.h"
 #include "format-table.h"
@@ -1963,11 +1962,7 @@ int dlopen_p11kit(int log_level) {
 #if HAVE_P11KIT
         static void *p11kit_dl = NULL;
 
-        SD_ELF_NOTE_DLOPEN(
-                        "p11-kit",
-                        "Support for PKCS11 hardware tokens",
-                        SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
-                        "libp11-kit.so.0");
+        LIBP11KIT_NOTE(suggested);
 
         return dlopen_many_sym_or_warn(
                         &p11kit_dl,
index a5bf75f88918cd1188b370203f16fa55683dbf1c..34755ca41fc3ee92c29f974b6b692a8029d7236a 100644 (file)
 #endif
 #include <stdio.h>
 
-#include "sd-dlopen.h"
-
 #include "ansi-color.h"
 #include "dlfcn-util.h"
+#include "dlopen-note.h"
 #include "locale-util.h"
 #include "log.h"
 #include "strv.h"
@@ -34,11 +33,7 @@ int dlopen_qrencode(int log_level) {
         static void *qrcode_dl = NULL;
         int r;
 
-        SD_ELF_NOTE_DLOPEN(
-                        "qrencode",
-                        "Support for generating QR codes",
-                        SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED,
-                        "libqrencode.so.4", "libqrencode.so.3");
+        LIBQRENCODE_NOTE(suggested);
 
         FOREACH_STRING(s, "libqrencode.so.4", "libqrencode.so.3") {
                 r = dlopen_many_sym_or_warn(
index 0ba0d6cd91c0fca99598469bda41de092cd82676..2a8995666feeae2368f999dc5c4e7720f44a10a2 100644 (file)
@@ -16,8 +16,6 @@
 #include <asm/sgidefs.h>
 #endif
 
-#include "sd-dlopen.h"
-
 #include "af-list.h"
 #include "alloc-util.h"
 #include "env-util.h"
@@ -2604,7 +2602,7 @@ int dlopen_libseccomp(int log_level) {
 #if HAVE_SECCOMP
         static void *libseccomp_dl = NULL;
 
-        LIBSECCOMP_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        LIBSECCOMP_NOTE(recommended);
 
         return dlopen_many_sym_or_warn(
                         &libseccomp_dl,
index 2bcb2d935bad08eb2814d2098646452a0dc75ddb..91e6bc886e556f3276970abcccc057f40f13954a 100644 (file)
@@ -1,8 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-dlopen.h"
-
+#include "dlopen-note.h"
 #include "errno-util.h"
 #include "shared-forward.h"
 
@@ -161,17 +160,6 @@ int parse_syscall_and_errno(const char *in, char **name, int *error);
 
 int seccomp_suppress_sync(void);
 
-#define LIBSECCOMP_NOTE(priority)                                       \
-        SD_ELF_NOTE_DLOPEN("seccomp",                                   \
-                           "Support for Seccomp Sandboxes",             \
-                           priority,                                    \
-                           "libseccomp.so.2")
-
-#define DLOPEN_LIBSECCOMP(log_level, priority)                          \
-        ({                                                              \
-                LIBSECCOMP_NOTE(priority);                              \
-                dlopen_libseccomp(log_level);                           \
-        })
 #else
 
 static inline bool is_seccomp_available(void) {
@@ -179,11 +167,16 @@ static inline bool is_seccomp_available(void) {
 }
 
 
-#define DLOPEN_LIBSECCOMP(log_level, priority) dlopen_libseccomp(log_level)
 #endif
 
 int dlopen_libseccomp(int log_level);
 
+#define DLOPEN_LIBSECCOMP(log_level, priority)                          \
+        ({                                                              \
+                LIBSECCOMP_NOTE(priority);                              \
+                dlopen_libseccomp(log_level);                           \
+        })
+
 /* This is a special value to be used where syscall filters otherwise expect errno numbers, will be
    replaced with real seccomp action. */
 enum {
index eb1f28a814429f6c2904f0bbb932e679d36e0fad..ec10b5b846a77d1cef4e824feb94beb2389b509f 100644 (file)
@@ -17,8 +17,6 @@
 #include <selinux/label.h>
 #include <selinux/selinux.h>
 
-#include "sd-dlopen.h"
-
 #include "alloc-util.h"
 #include "fd-util.h"
 #include "path-util.h"
@@ -94,7 +92,7 @@ int dlopen_libselinux(int log_level) {
 #if HAVE_SELINUX
         static void *libselinux_dl = NULL;
 
-        LIBSELINUX_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        LIBSELINUX_NOTE(recommended);
 
         return dlopen_many_sym_or_warn(
                         &libselinux_dl,
index 3cc48dd3acd92bb71051bb04392693dafc218d10..5c8181131e8bb31add84838e561b1b2328eb6607 100644 (file)
@@ -3,8 +3,7 @@
 
 #include <sys/socket.h>
 
-#include "sd-dlopen.h"
-
+#include "dlopen-note.h"
 #include "shared-forward.h"
 
 #if HAVE_SELINUX
@@ -56,29 +55,22 @@ extern DLSYM_PROTOTYPE(string_to_security_class);
 
 DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(char*, sym_freecon, freeconp, NULL);
 
-#define LIBSELINUX_NOTE(priority)                                       \
-        SD_ELF_NOTE_DLOPEN("selinux",                                   \
-                           "Support for SELinux",                       \
-                           priority,                                    \
-                           "libselinux.so.1")
-
-#define DLOPEN_LIBSELINUX(log_level, priority)                          \
-        ({                                                              \
-                LIBSELINUX_NOTE(priority);                              \
-                dlopen_libselinux(log_level);                           \
-        })
 #else
 
-
 static inline void freeconp(char **p) {
         assert(*p == NULL);
 }
 
-#define DLOPEN_LIBSELINUX(log_level, priority) dlopen_libselinux(log_level)
 #endif
 
 int dlopen_libselinux(int log_level);
 
+#define DLOPEN_LIBSELINUX(log_level, priority)                          \
+        ({                                                              \
+                LIBSELINUX_NOTE(priority);                              \
+                dlopen_libselinux(log_level);                           \
+        })
+
 #define _cleanup_freecon_ _cleanup_(freeconp)
 
 /* This accepts 0 error, like _zerook(). */
index 80af61654e2a69f38ef31530d8e8629026afe6d0..14ace396cd6593773b4c24ebcc27e28118f50b99 100644 (file)
@@ -1,7 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include "sd-dlopen.h"
-
 #include "log.h"                /* IWYU pragma: keep */
 #include "ssl-util.h"
 #include "strv.h"
@@ -38,7 +36,7 @@ int dlopen_libssl(int log_level) {
         static void *libssl_dl = NULL;
         int r;
 
-        LIBSSL_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED);
+        LIBSSL_NOTE(suggested);
 
         FOREACH_STRING(soname, "libssl.so.4", "libssl.so.3") {
                 r = dlopen_many_sym_or_warn(
index 3a9a4084da34d1e026d69b2c01e15e47330c18ad..8d60b16a1e715cd42a429e1539284fb69f89a377 100644 (file)
@@ -1,29 +1,14 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-dlopen.h"
-
+#include "dlopen-note.h"
 #include "shared-forward.h"
 
-int dlopen_libssl(int log_level);
-
 #if HAVE_OPENSSL
 #ifndef SYSTEMD_CFLAGS_MARKER_LIBOPENSSL
 #  error "missing libopenssl_cflags in meson dependency."
 #endif
 
-#define LIBSSL_NOTE(priority)                                           \
-        SD_ELF_NOTE_DLOPEN("libssl",                                    \
-                           "Support for TLS",                           \
-                           priority,                                    \
-                           "libssl.so.4", "libssl.so.3")
-
-#define DLOPEN_LIBSSL(log_level, priority)                              \
-        ({                                                              \
-                LIBSSL_NOTE(priority);                                  \
-                dlopen_libssl(log_level);                               \
-        })
-
 #  include <openssl/ssl.h>              /* IWYU pragma: export */
 
 #  include "dlfcn-util.h"
@@ -60,7 +45,12 @@ extern DLSYM_PROTOTYPE(TLS_client_method);
 
 DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(SSL*, sym_SSL_free, SSL_freep, NULL);
 DEFINE_TRIVIAL_CLEANUP_FUNC_FULL_RENAME(SSL_CTX*, sym_SSL_CTX_free, SSL_CTX_freep, NULL);
-
-#else
-#define DLOPEN_LIBSSL(log_level, priority) dlopen_libssl(log_level)
 #endif
+
+int dlopen_libssl(int log_level);
+
+#define DLOPEN_LIBSSL(log_level, priority)                              \
+        ({                                                              \
+                LIBSSL_NOTE(priority);                                  \
+                dlopen_libssl(log_level);                               \
+        })
index 11ae999093a3643113b3ca9901d704615a9bf246..854d7fc4c5548e0ac3bc2a6982079e711488df11 100644 (file)
@@ -4,7 +4,6 @@
 #include <unistd.h>
 
 #include "sd-device.h"
-#include "sd-dlopen.h"
 
 #include "alloc-util.h"
 #include "ansi-color.h"
@@ -171,7 +170,7 @@ static int dlopen_tpm2_esys(int log_level) {
         static void *libtss2_esys_dl = NULL;
         int r;
 
-        TPM2_ESYS_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED);
+        LIBTSS2_ESYS_NOTE(suggested);
 
         r = dlopen_many_sym_or_warn(
                         &libtss2_esys_dl, "libtss2-esys.so.0", log_level,
@@ -233,7 +232,7 @@ static int dlopen_tpm2_esys(int log_level) {
 static int dlopen_tpm2_rc(int log_level) {
         static void *libtss2_rc_dl = NULL;
 
-        TPM2_RC_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED);
+        LIBTSS2_RC_NOTE(suggested);
 
         return dlopen_many_sym_or_warn(
                         &libtss2_rc_dl, "libtss2-rc.so.0", log_level,
@@ -243,7 +242,7 @@ static int dlopen_tpm2_rc(int log_level) {
 static int dlopen_tpm2_mu(int log_level) {
         static void *libtss2_mu_dl = NULL;
 
-        TPM2_MU_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED);
+        LIBTSS2_MU_NOTE(suggested);
 
         return dlopen_many_sym_or_warn(
                         &libtss2_mu_dl, "libtss2-mu.so.0", log_level,
@@ -275,7 +274,7 @@ static int dlopen_tpm2_tcti_device(int log_level) {
         /* The "device" TCTI is the most relevant one, let's also load it explicitly on dlopen_tpm2(), even
          * if we don't resolve any symbols here. */
 
-        TPM2_TCTI_DEVICE_NOTE(SD_ELF_NOTE_DLOPEN_PRIORITY_SUGGESTED);
+        LIBTSS2_TCTI_DEVICE_NOTE(suggested);
 
         return dlopen_verbose(
                         &libtss2_tcti_device_dl,
index ea69940701e4f670c595ebc85f6d3fb2bc71d2f7..63c449a31aa73a7219d74ea84bf1258133df51d3 100644 (file)
@@ -1,9 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-dlopen.h"
-
 #include "bitfield.h"
+#include "dlopen-note.h"
 #include "iovec-util.h"
 #include "shared-forward.h"
 #include "sha256.h"
@@ -58,34 +57,17 @@ int dlopen_tpm2(int log_level);
  * other tokens. */
 #define ERRNO_IS_NEG_TPM2_TOKEN_MISMATCH(r) IN_SET(r, -EREMCHG, -ENOANO, -EPERM, -ENOSTR, -EREMOTE, -EADDRNOTAVAIL)
 
-#if HAVE_TPM2
-#ifndef SYSTEMD_CFLAGS_MARKER_TPM2
-#  error "missing tpm2_cflags in meson dependency."
-#endif
-
-#define TPM2_ESYS_NOTE(priority) \
-        SD_ELF_NOTE_DLOPEN("tpm", "Support for TPM", priority, "libtss2-esys.so.0")
-#define TPM2_RC_NOTE(priority) \
-        SD_ELF_NOTE_DLOPEN("tpm", "Support for TPM", priority, "libtss2-rc.so.0")
-#define TPM2_MU_NOTE(priority) \
-        SD_ELF_NOTE_DLOPEN("tpm", "Support for TPM", priority, "libtss2-mu.so.0")
-#define TPM2_TCTI_DEVICE_NOTE(priority) \
-        SD_ELF_NOTE_DLOPEN("tpm", "Support for TPM", priority, "libtss2-tcti-device.so.0")
-
-#define TPM2_NOTE(priority)                                             \
-        ({                                                              \
-                TPM2_ESYS_NOTE(priority);                               \
-                TPM2_RC_NOTE(priority);                                 \
-                TPM2_MU_NOTE(priority);                                 \
-                TPM2_TCTI_DEVICE_NOTE(priority);                        \
-        })
-
 #define DLOPEN_TPM2(log_level, priority)                                \
         ({                                                              \
                 TPM2_NOTE(priority);                                    \
                 dlopen_tpm2(log_level);                                 \
         })
 
+#if HAVE_TPM2
+#ifndef SYSTEMD_CFLAGS_MARKER_TPM2
+#  error "missing tpm2_cflags in meson dependency."
+#endif
+
 #include <tss2/tss2_esys.h>     /* IWYU pragma: export */
 #include <tss2/tss2_mu.h>       /* IWYU pragma: export */
 #include <tss2/tss2_rc.h>       /* IWYU pragma: export */
@@ -483,8 +465,6 @@ typedef struct Tpm2PCRValue {} Tpm2PCRValue;
 static inline int tpm2_pcrlock_search_file(const char *path, FILE **ret_file, char **ret_path) {
         return -ENOENT;
 }
-
-#define DLOPEN_TPM2(log_level, priority) dlopen_tpm2(log_level)
 #endif /* HAVE_TPM2 */
 
 int tpm2_list_devices(bool legend, bool quiet);
index 585a2f85a680d5d568e8c881aad66a09dd06b975..9584284a56040e63aee2633df3a4afb83d743c79 100644 (file)
@@ -36,7 +36,7 @@ int swap_list_get(const char *swaps, SwapDevice **head) {
 
         assert(head);
 
-        r = DLOPEN_LIBMOUNT(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBMOUNT(LOG_ERR, recommended);
         if (r < 0)
                 return r;
 
index e789af2e2f5b05ac566c7fe3a645baa089ec613b..c8c50279f5bdbc4d57a0b18250de19552a4008f7 100644 (file)
@@ -1828,7 +1828,7 @@ static int unmerge(
         bool need_to_reload;
         int r;
 
-        (void) DLOPEN_LIBMOUNT(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        (void) DLOPEN_LIBMOUNT(LOG_DEBUG, required);
 
         r = get_extension_release_metadata(image_class, hierarchies, no_reload, &need_to_reload, &units_to_restart, &units_to_reload_or_restart);
         if (r < 0)
@@ -2413,9 +2413,9 @@ static int merge(ImageClass image_class,
 
         int r;
 
-        (void) DLOPEN_CRYPTSETUP(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
-        (void) DLOPEN_LIBBLKID(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
-        (void) DLOPEN_LIBMOUNT(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        (void) DLOPEN_CRYPTSETUP(LOG_DEBUG, recommended);
+        (void) DLOPEN_LIBBLKID(LOG_DEBUG, required);
+        (void) DLOPEN_LIBMOUNT(LOG_DEBUG, required);
 
         _cleanup_(pidref_done) PidRef pidref = PIDREF_NULL;
         r = pidref_safe_fork("(sd-merge)", FORK_DEATHSIG_SIGTERM|FORK_LOG|FORK_NEW_MOUNTNS, &pidref);
index 6361093231dcbd92648e03bed38c6ac09b6872f7..3fca5cc91ea48517a23eb9a5e975875dfcae8590 100644 (file)
@@ -161,7 +161,7 @@ int find_suitable_partition(
         POINTER_MAY_BE_NULL(partition_type);
         assert(ret);
 
-        r = DLOPEN_FDISK(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_FDISK(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
@@ -230,7 +230,7 @@ int patch_partition(
         if (change == 0) /* Nothing to do */
                 return 0;
 
-        r = DLOPEN_FDISK(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_FDISK(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
index 275d8d7c15e0465cad5bff5910b2211f9edab5bd..4f46e27869c93038c98cde0c40a58f18caae793c 100644 (file)
@@ -233,7 +233,7 @@ static int resource_load_from_blockdev(Resource *rr) {
 
         assert(rr);
 
-        r = DLOPEN_FDISK(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_FDISK(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
index 5d914bc4ba5aeb403f337da3a407d38fef59590f..261a4f0b92a530acf9fde9c51c605449716be031 100644 (file)
@@ -1270,7 +1270,7 @@ static int parse_acl_cond_exec(
         assert(cond_exec);
         assert(ret);
 
-        r = DLOPEN_LIBACL(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBACL(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
@@ -1389,7 +1389,7 @@ static int path_set_acl(
 
         assert(c);
 
-        r = DLOPEN_LIBACL(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        r = DLOPEN_LIBACL(LOG_DEBUG, recommended);
         if (r < 0)
                 return r;
 
index 86cfdb5d2845b28c957f9d113d516e8693766eb9..897c4daf14fd8afe3880a80e21712a5ce27bd599 100644 (file)
@@ -599,11 +599,11 @@ static int run(int argc, char *argv[]) {
                 return EXIT_SUCCESS;
         }
 
-        r = DLOPEN_LIBCRYPTO(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_LIBCRYPTO(LOG_ERR, required);
         if (r < 0)
                 return r;
 
-        r = DLOPEN_TPM2(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_TPM2(LOG_ERR, required);
         if (r < 0)
                 return r;
 
index dcba83a5bd4bb73f8d66f1808f3479be0e32fb86..f9f6890284144b757956204b757c514a8432285d 100644 (file)
@@ -520,7 +520,7 @@ static int builtin_blkid(UdevEvent *event, int argc, char *argv[]) {
         int64_t offset = 0;
         int r;
 
-        r = DLOPEN_LIBBLKID(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_LIBBLKID(LOG_DEBUG, required);
         if (r < 0)
                 return log_device_debug_errno(dev, r, "blkid not available: %m");
 
index 4cbc481c7681d3686f3539b7d1ac968607f595e2..b452a1e848a778d7497b0e46f69095ca5c99d965 100644 (file)
@@ -58,11 +58,11 @@ int run_udevd(int argc, char *argv[]) {
                 return log_error_errno(r, "Failed to create /run/udev: %m");
 
         /* Load some shared libraries before we fork any workers */
-        (void) DLOPEN_LIBACL(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
-        (void) DLOPEN_LIBBLKID(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
-        (void) DLOPEN_LIBKMOD(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
-        (void) DLOPEN_LIBMOUNT(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
-        (void) DLOPEN_TPM2(LOG_DEBUG, SD_ELF_NOTE_DLOPEN_PRIORITY_RECOMMENDED);
+        (void) DLOPEN_LIBACL(LOG_DEBUG, recommended);
+        (void) DLOPEN_LIBBLKID(LOG_DEBUG, recommended);
+        (void) DLOPEN_LIBKMOD(LOG_DEBUG, recommended);
+        (void) DLOPEN_LIBMOUNT(LOG_DEBUG, recommended);
+        (void) DLOPEN_TPM2(LOG_DEBUG, recommended);
 
         if (arg_daemonize) {
                 pid_t pid;
index 994fcbeb13d03fffe253834073857bff1ced0954..0f4780ada583979c6f6c74e2185544eedd0fc595 100644 (file)
@@ -290,7 +290,7 @@ static int validate_gpt_metadata_one(sd_device *d, const char *path, const Valid
         assert(d);
         assert(f);
 
-        r = DLOPEN_LIBBLKID(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_LIBBLKID(LOG_ERR, required);
         if (r < 0)
                 return r;
 
index 2b02694b9b1fdb1709ebba60272cc34f268e4452..dde1910866b9a051719f27a50ebdeffb59849988 100644 (file)
@@ -493,7 +493,7 @@ static int run(int argc, char *argv[]) {
 
         log_setup();
 
-        r = DLOPEN_CRYPTSETUP(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED);
+        r = DLOPEN_CRYPTSETUP(LOG_ERR, required);
         if (r < 0)
                 return r;