This commit is contained in:
ColMelvin 2024-07-17 21:52:48 -05:00 committed by GitHub
commit baab958f39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 5 deletions

View File

@ -379,6 +379,10 @@ decrypt_mount(pam_handle_t *pamh, const char *ds_name,
pam_syslog(pamh, LOG_ERR, "dataset %s not found", ds_name);
return (-1);
}
if (zfs_prop_get_int(ds, ZFS_PROP_MOUNTED)) {
zfs_close(ds);
return (0);
}
pw_password_t *key = prepare_passphrase(pamh, ds, passphrase, NULL);
if (key == NULL) {
zfs_close(ds);
@ -840,11 +844,7 @@ pam_sm_open_session(pam_handle_t *pamh, int flags,
return (PAM_SUCCESS);
}
int counter = zfs_key_config_modify_session_counter(pamh, &config, 1);
if (counter != 1) {
zfs_key_config_free(&config);
return (PAM_SUCCESS);
}
(void) zfs_key_config_modify_session_counter(pamh, &config, 1);
const pw_password_t *token = pw_get(pamh,
PAM_AUTHTOK, PASSWORD_VAR_NAME);