mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-26 08:55:18 +03:00
cryptsetup: Treat key file errors as a failed password attempt
6f177c7dc0
caused key file errors to immediately fail, which would make it hard to correct an issue due to e.g. a crypttab typo or a damaged key file.
Closes #11723.
This commit is contained in:
parent
510dc4da13
commit
c20db38875
@ -557,6 +557,10 @@ static int attach_luks_or_plain(struct crypt_device *cd,
|
||||
log_error_errno(r, "Failed to activate with key file '%s'. (Key data incorrect?)", key_file);
|
||||
return -EAGAIN; /* Log actual error, but return EAGAIN */
|
||||
}
|
||||
if (r == -EINVAL) {
|
||||
log_error_errno(r, "Failed to activate with key file '%s'. (Key file missing?)", key_file);
|
||||
return -EAGAIN; /* Log actual error, but return EAGAIN */
|
||||
}
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to activate with key file '%s': %m", key_file);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user