1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

cryptsetup: optionally turn off token module support in libcryptsetup

This is useful for debugging purposes.
This commit is contained in:
Lennart Poettering 2021-10-08 18:26:12 +02:00
parent 92828080fb
commit 64c590fb06

View File

@ -18,6 +18,7 @@
#include "cryptsetup-util.h" #include "cryptsetup-util.h"
#include "device-util.h" #include "device-util.h"
#include "efi-loader.h" #include "efi-loader.h"
#include "env-util.h"
#include "escape.h" #include "escape.h"
#include "fileio.h" #include "fileio.h"
#include "fs-util.h" #include "fs-util.h"
@ -738,7 +739,16 @@ static int make_security_device_monitor(sd_event *event, sd_device_monitor **ret
static bool libcryptsetup_plugins_support(void) { static bool libcryptsetup_plugins_support(void) {
#if HAVE_LIBCRYPTSETUP_PLUGINS #if HAVE_LIBCRYPTSETUP_PLUGINS
return crypt_token_external_path() != NULL; int r;
/* Permit a way to disable libcryptsetup token module support, for debugging purposes. */
r = getenv_bool("SYSTEMD_CRYPTSETUP_USE_TOKEN_MODULE");
if (r < 0 && r != -ENXIO)
log_debug_errno(r, "Failed to parse $SYSTEMD_CRYPTSETUP_USE_TOKEN_MODULE env var: %m");
if (r == 0)
return false;
return crypt_token_external_path();
#else #else
return false; return false;
#endif #endif