crytsetup: allow overriding the token .so library path via an env var

I tried to get something similar upstream:

https://gitlab.com/cryptsetup/cryptsetup/-/issues/846

But no luck, it was suggested I use ELF interposition instead. Hence,
let's do so (but not via ugly LD_PRELOAD, but simply by overriding the
relevant symbol natively in our own code).

This makes debugging tokens a ton easier.
This commit is contained in:
Lennart Poettering
2023-11-02 18:18:00 +00:00
committed by Luca Boccassi
parent 2bdd7a8ac9
commit 0631eac96d
2 changed files with 42 additions and 0 deletions
+5
View File
@@ -465,6 +465,11 @@ disk images with `--image=` or similar:
activating via FIDO2, PKCS#11, TPM2, i.e. mechanisms natively supported by
`systemd-cryptsetup`. Defaults to enabled.
* `$SYSTEMD_CRYPTSETUP_TOKEN_PATH` – takes a path to a directory in the file
system. If specified overrides where libcryptsetup will look for token
modules (.so). This is useful for debugging token modules: set this
environment variable to the build directory and you are set.
Various tools that read passwords from the TTY, such as `systemd-cryptenroll`
and `homectl`: