mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-06 00:10:04 +01:00
Fix initialization of unknown used device.
dm_query can return open count, this should be processed as success (and properly fail later ;-)
This commit is contained in:
@@ -721,6 +721,8 @@ static int _init_by_name_crypt(struct crypt_device *cd, const char *name)
|
||||
DM_ACTIVE_CRYPT_KEYSIZE, &dmd);
|
||||
if (r < 0)
|
||||
goto out;
|
||||
if (r > 0)
|
||||
r = 0;
|
||||
|
||||
if (isPLAIN(cd->type)) {
|
||||
cd->u.plain.hdr.hash = NULL; /* no way to get this */
|
||||
@@ -798,6 +800,8 @@ static int _init_by_name_verity(struct crypt_device *cd, const char *name)
|
||||
DM_ACTIVE_VERITY_PARAMS, &dmd);
|
||||
if (r < 0)
|
||||
goto out;
|
||||
if (r > 0)
|
||||
r = 0;
|
||||
|
||||
if (isVERITY(cd->type)) {
|
||||
cd->u.verity.uuid = NULL; // FIXME
|
||||
|
||||
Reference in New Issue
Block a user