Fix detection of target presence.

This commit is contained in:
Milan Broz
2017-06-01 12:25:39 +02:00
parent 40a9178c7f
commit 6fc383ade1
3 changed files with 16 additions and 4 deletions

View File

@@ -290,7 +290,7 @@ int VERITY_activate(struct crypt_device *cd,
}
r = dm_create_device(cd, name, CRYPT_VERITY, &dmd, 0);
if (r < 0 && !dm_flags(DM_VERITY, &dmv_flags) && !(dmv_flags & DM_VERITY_SUPPORTED)) {
if (r < 0 && (dm_flags(DM_VERITY, &dmv_flags) || !(dmv_flags & DM_VERITY_SUPPORTED))) {
log_err(cd, _("Kernel doesn't support dm-verity mapping.\n"));
return -ENOTSUP;
}