Fxi luksKill slot to work in batch mode in non-tty environment.

If there is no TTY on stdin (like nohup or service) then
batch mode should not fail to kill slot.

For more info see Issue#329.
This commit is contained in:
Milan Broz
2017-06-21 13:31:08 +02:00
parent ce1e5374b9
commit c80dbb2210
3 changed files with 12 additions and 0 deletions

View File

@@ -933,6 +933,12 @@ static int action_luksKillSlot(void)
_("This is the last keyslot. Device will become unusable after purging this key."),
_("Enter any remaining passphrase: "),
opt_key_file, opt_keyfile_offset, opt_keyfile_size);
if (r == -EPIPE && (!opt_key_file || tools_is_stdin(opt_key_file))) {
log_dbg("Failed read from input, ignoring passphrase.");
r = 0;
}
if (r < 0)
goto out;
}