]> git.proxmox.com Git - mirror_zfs.git/commitdiff
PAM: do not fail to mount if the key's already loaded
authorVal Packett <val@packett.cool>
Fri, 5 May 2023 23:00:48 +0000 (20:00 -0300)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 1 Jun 2023 00:00:15 +0000 (17:00 -0700)
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

contrib/pam_zfs_key/pam_zfs_key.c

index 979546ab3090b7303473fbb19e831eb88b1e5224..9d9076e1aa0def558bdda00072934647a8a0cdc7 100644 (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);