cryptsetup: ask for password, if key file cannot be accessed

If the key file cannot be accessed, we can at least ask for the
password.
This commit is contained in:
Harald Hoyer 2013-04-18 09:41:23 +02:00 committed by Lennart Poettering
parent 4befe2eba0
commit 8d768d9962
1 changed files with 5 additions and 0 deletions

View File

@ -500,6 +500,11 @@ int main(int argc, char *argv[]) {
if (key_file)
k = crypt_activate_by_keyfile_offset(cd, argv[2], CRYPT_ANY_SLOT, key_file, opt_keyfile_size,
opt_keyfile_offset, flags);
if (k < 0) {
log_error("Failed to activate with key file '%s': %s", key_file, strerror(-k));
key_file = NULL;
continue;
}
else {
char **p;