diff options
author | Harald Hoyer <harald@redhat.com> | 2013-04-18 09:41:23 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-04-18 22:17:13 +0200 |
commit | 8d768d9962b3c9348a732bb83434911e1d2d9775 (patch) | |
tree | 2e2250252148d0f77151929d4703ba466ea1cdf6 /src | |
parent | 4befe2eba061fa47cd0c30eff3f8348971e5d088 (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptsetup/cryptsetup.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index 376f748153..a24e61a035 100644 --- a/src/cryptsetup/cryptsetup.c +++ b/src/cryptsetup/cryptsetup.c @@ -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; |