[systemd-commits] src/cryptsetup

Lennart Poettering lennart at kemper.freedesktop.org
Thu Apr 18 13:17:52 PDT 2013


 src/cryptsetup/cryptsetup.c |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 8d768d9962b3c9348a732bb83434911e1d2d9775
Author: Harald Hoyer <harald at redhat.com>
Date:   Thu Apr 18 09:41:23 2013 +0200

    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.

diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index 376f748..a24e61a 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;
 



More information about the systemd-commits mailing list