mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
Change external token handlers (plugins) default location.
Search for token handlers in %{libdir}/cryptsetup directory
by default. Distros may change default location via
--with-luks2-external-tokens-path parameter during configuration.
This commit is contained in:
@@ -131,7 +131,7 @@ crypt_token_load_external(struct crypt_device *cd, const char *name, struct cryp
|
||||
#if USE_EXTERNAL_TOKENS
|
||||
struct crypt_token_handler_v2 *token;
|
||||
void *h;
|
||||
char buf[512];
|
||||
char buf[PATH_MAX];
|
||||
int r;
|
||||
|
||||
if (!external_tokens_enabled)
|
||||
@@ -147,10 +147,12 @@ crypt_token_load_external(struct crypt_device *cd, const char *name, struct cryp
|
||||
|
||||
token = &ret->u.v2;
|
||||
|
||||
r = snprintf(buf, sizeof(buf), "libcryptsetup-token-%s.so", name);
|
||||
r = snprintf(buf, sizeof(buf), "%s/libcryptsetup-token-%s.so", EXTERNAL_LUKS2_TOKENS_PATH, name);
|
||||
if (r < 0 || (size_t)r >= sizeof(buf))
|
||||
return -EINVAL;
|
||||
|
||||
assert(*buf == '/');
|
||||
|
||||
log_dbg(cd, "Trying to load %s.", buf);
|
||||
|
||||
h = dlopen(buf, RTLD_LAZY);
|
||||
|
||||
Reference in New Issue
Block a user