Commit b86a652b authored by Milan Broz's avatar Milan Broz

Return back check for inactive keyslot for luksKillSlot.

parent 59683236
......@@ -1218,6 +1218,18 @@ static int action_luksKillSlot(void)
if ((r = crypt_load(cd, luksType(opt_type), NULL)))
goto out;
switch (crypt_keyslot_status(cd, opt_key_slot)) {
case CRYPT_SLOT_ACTIVE_LAST:
case CRYPT_SLOT_ACTIVE:
log_verbose(_("Keyslot %d is selected for deletion.\n"), opt_key_slot);
break;
case CRYPT_SLOT_INACTIVE:
log_err(_("Keyslot %d is not active.\n"), opt_key_slot);
/* pass through */
case CRYPT_SLOT_INVALID:
return -EINVAL;
}
if (!opt_batch_mode || opt_key_file || !isatty(STDIN_FILENO)) {
r = verify_keyslot(cd, opt_key_slot,
_("This is the last keyslot. Device will become unusable after purging this key."),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment