Skip to content

keyring: Prefer the most recent item

Ondrej Holy requested to merge wip/oholy/keyring-order into master

If keyring contains more entries for one host, the first one is always used. However, this is not always the best one. Imagine the situation that the username was changed on the server for some reason and the previous username is invalid. When user connects using the new username, a new entry is added to the keyring. However, next time the old username is automatically used when mounting using the hostname only, which leads to login failures and the user has to specify its password each time... Prefer the most recent item from keyring if they are equal in specificity in order to prevent such issues.

It would be best to remove the invalid entry automatically from the keyring, but it is not safe to remove it just in case of login failure, because it might be just some network outage, or so...

#352 (closed)

Merge request reports