PAM: do not fail to mount if the key's already loaded

If we're expecting a working home directory on login, it would be
rather frustrating to not have it mounted just because it e.g. failed to
unmount once on logout.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Felix Dörre <felix@dogcraft.de>
Signed-off-by: Val Packett <val@packett.cool>
Closes #14834
This commit is contained in:
Val Packett 2023-05-05 20:00:48 -03:00 committed by Brian Behlendorf
parent 2810dda80b
commit c47b708647
1 changed files with 1 additions and 1 deletions

View File

@ -386,7 +386,7 @@ decrypt_mount(pam_handle_t *pamh, const char *ds_name,
int ret = lzc_load_key(ds_name, noop, (uint8_t *)key->value,
WRAPPING_KEY_LEN);
pw_free(key);
if (ret) {
if (ret && ret != EEXIST) {
pam_syslog(pamh, LOG_ERR, "load_key failed: %d", ret);
zfs_close(ds);
return (-1);