Fix wrong return value on error in keyring utils.

keyring_link_key_to_keyring_key_type could accidentaly
mask an unreachable key and make it look that key was
succesfully linked in custome keyring when it was not.
This commit is contained in:
Ondrej Kozina
2023-09-06 16:05:59 +02:00
committed by Milan Broz
parent b0610e1f73
commit 4872a14830

View File

@@ -351,7 +351,7 @@ static int keyring_link_key_to_keyring_key_type(const char *type_name, const cha
} while (kid < 0 && errno == EINTR);
if (kid < 0)
return 0;
return -errno;
/* see https://mjg59.dreamwidth.org/37333.html */
if (keyring_to_link == KEY_SPEC_USER_KEYRING || keyring_to_link == KEY_SPEC_USER_SESSION_KEYRING)