mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-24 01:00:15 +01:00
Add LUKS open and format test using new api.
Fix some error messages. git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@102 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
15
lib/setup.c
15
lib/setup.c
@@ -1265,13 +1265,17 @@ int crypt_keyslot_destroy(struct crypt_device *cd, int keyslot)
|
||||
}
|
||||
|
||||
ki = crypt_keyslot_status(cd, keyslot);
|
||||
if (ki == SLOT_INVALID)
|
||||
if (ki == SLOT_INVALID) {
|
||||
log_err(cd, _("Key slot %d is invalid.\n"), keyslot);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (ki == SLOT_INACTIVE)
|
||||
return 0;
|
||||
if (ki == SLOT_INACTIVE) {
|
||||
log_err(cd, _("Key slot %d is not used.\n"), keyslot);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return LUKS_del_key(cd->device, keyslot, cd);
|
||||
return LUKS_del_key(cd->device, keyslot, &cd->hdr, cd);
|
||||
}
|
||||
|
||||
// activation/deactivation of device mapping
|
||||
@@ -1464,7 +1468,8 @@ int crypt_deactivate(struct crypt_device *cd, const char *name)
|
||||
case ACTIVE: return dm_remove_device(name, 0, 0);
|
||||
case BUSY: log_err(cd, _("Device %s is busy."), name);
|
||||
return -EBUSY;
|
||||
case INACTIVE: return -ENODEV;
|
||||
case INACTIVE: log_err(cd, _("Device %s is not active."), name);
|
||||
return -ENODEV;
|
||||
default: log_err(cd, _("Invalid device %s."), name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user