Do not attempt to unload external tokens if USE_EXTERNAL_TOKENS is disabled.

This allows building a static binary as long as --disable-external-tokens is used
This commit is contained in:
Hector Martin
2021-09-17 05:44:18 +00:00
parent 8a0682650e
commit a1b577c085

View File

@@ -245,6 +245,7 @@ int crypt_token_register(const crypt_token_handler *handler)
void crypt_token_unload_external_all(struct crypt_device *cd)
{
#if USE_EXTERNAL_TOKENS
int i;
for (i = LUKS2_TOKENS_MAX - 1; i >= 0; i--) {
@@ -258,6 +259,7 @@ void crypt_token_unload_external_all(struct crypt_device *cd)
if (dlclose(CONST_CAST(void *)token_handlers[i].u.v2.dlhandle))
log_dbg(cd, "%s", dlerror());
}
#endif
}
static const void