mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
tcrypt: Fix detecting status of chained modes
The function dm_uuid_cmp cannot be used for TCRYPT, it expects LUKS UUID, not a device name. Fixes: #952
This commit is contained in:
@@ -928,14 +928,16 @@ out:
|
|||||||
|
|
||||||
static bool is_tcrypt_subdev(const char *dm_uuid, const char *base_uuid)
|
static bool is_tcrypt_subdev(const char *dm_uuid, const char *base_uuid)
|
||||||
{
|
{
|
||||||
assert(base_uuid);
|
const char *base_uuid_name;
|
||||||
|
|
||||||
if (!dm_uuid)
|
assert(base_uuid);
|
||||||
|
base_uuid_name = strchr(base_uuid, '-');
|
||||||
|
|
||||||
|
if (!dm_uuid || !base_uuid_name)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!strncmp(dm_uuid, "SUBDEV-", 7))
|
if (!strncmp(dm_uuid, "SUBDEV-", 7))
|
||||||
/* dm_uuid + 6 because function requires dm_uuid to contain '-' */
|
return !strncmp(dm_uuid + 6, base_uuid_name, strlen(base_uuid_name));
|
||||||
return !dm_uuid_cmp(dm_uuid + 6, strchr(base_uuid, '-'));
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FIXME: Drop after shift to dependency based deactivation (CRYPT_SUBDEV)
|
* FIXME: Drop after shift to dependency based deactivation (CRYPT_SUBDEV)
|
||||||
|
|||||||
Reference in New Issue
Block a user