From: Luca Boccassi Date: Mon, 22 Jun 2026 21:48:53 +0000 (+0100) Subject: tpm2-setup: call DLOPEN_TPM2 to add dependency and fail immediately if not present X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7aa25bb25601a4242a077796b506faff958fd92;p=thirdparty%2Fsystemd.git tpm2-setup: call DLOPEN_TPM2 to add dependency and fail immediately if not present tpm2-setup requires both libcrypto and the tpm2-tss libraries, but so far it only directly dlopen'ed libcrypto, with a clear error on startup if missing, and a dependency added via dlopen notes. Do the same for the tpm2-tss dlopens, to get a clear error and the required dependencies. --- diff --git a/src/tpm2-setup/tpm2-setup.c b/src/tpm2-setup/tpm2-setup.c index db508676966..20bb3f7011a 100644 --- a/src/tpm2-setup/tpm2-setup.c +++ b/src/tpm2-setup/tpm2-setup.c @@ -573,6 +573,10 @@ static int run(int argc, char *argv[]) { if (r < 0) return r; + r = DLOPEN_TPM2(LOG_ERR, SD_ELF_NOTE_DLOPEN_PRIORITY_REQUIRED); + if (r < 0) + return r; + umask(0022); /* Execute both jobs, and then return unlisted errors preferably, and listed errors