mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-07 08:50:05 +01:00
Change default error returned by token open.
It has to be -ENOENT since -EPERM would wrongly implied the token provided wrong keyslot passphrase.
This commit is contained in:
@@ -453,9 +453,9 @@ static int token_for_segment(struct luks2_hdr *hdr, json_object *jobj_token, int
|
|||||||
|
|
||||||
static int translate_errno(struct crypt_device *cd, int ret_val, const char *type)
|
static int translate_errno(struct crypt_device *cd, int ret_val, const char *type)
|
||||||
{
|
{
|
||||||
if ((ret_val > 0 || ret_val == -EINVAL || ret_val == -ENOENT) && !is_builtin_candidate(type)) {
|
if ((ret_val > 0 || ret_val == -EINVAL || ret_val == -EPERM) && !is_builtin_candidate(type)) {
|
||||||
log_dbg(cd, "%s token handler returned %d. Changing to %d.", type, ret_val, -EPERM);
|
log_dbg(cd, "%s token handler returned %d. Changing to %d.", type, ret_val, -ENOENT);
|
||||||
ret_val = -EPERM;
|
ret_val = -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret_val;
|
return ret_val;
|
||||||
|
|||||||
Reference in New Issue
Block a user