Skip to content

Commit

Permalink
PAM: do not fail to mount if the key's already loaded
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Felix Dörre <[email protected]>
Signed-off-by: Val Packett <[email protected]>
Closes #14834
  • Loading branch information
valpackett authored and behlendorf committed Jun 1, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 2810dda commit c47b708
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/pam_zfs_key/pam_zfs_key.c
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit c47b708

Please sign in to comment.