From df5be2c1b70cd5ad2e05ec2f6f642a3424284598 Mon Sep 17 00:00:00 2001 From: Chris Lindee Date: Sat, 29 Jan 2022 18:49:43 -0600 Subject: [PATCH] PAM: Mount if key is already available If, for some reason, the key is already loaded for an unmounted dataset, proceed with mounting the filesystem instead of failing. Signed-off-by: Chris Lindee --- contrib/pam_zfs_key/pam_zfs_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/pam_zfs_key/pam_zfs_key.c b/contrib/pam_zfs_key/pam_zfs_key.c index 1f0487e04f..0bf841dab0 100644 --- a/contrib/pam_zfs_key/pam_zfs_key.c +++ b/contrib/pam_zfs_key/pam_zfs_key.c @@ -389,7 +389,7 @@ decrypt_mount(pam_handle_t *pamh, const char *ds_name, int ret = lzc_load_key(ds_name, B_FALSE, (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);