PAM: support password changes even when not mounted
commitdb994458bbee99968827d88afd823d36ef82af28
authorVal Packett <val@packett.cool>
Sat, 6 May 2023 01:17:12 +0000 (5 22:17 -0300)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 1 Jun 2023 00:01:11 +0000 (31 17:01 -0700)
treee68c0d2b219e058f243a48d92678809553d7eef2
parente3ba6b93de32bc76e9e616472af1c7aafea585a5
PAM: support password changes even when not mounted

There's usually no requirement that a user be logged in for changing
their password, so let's not be surprising here.

We need to use the fetch_lazy mechanism for the old password to avoid
a double prompt for it, so that mechanism is now generalized a bit.

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
tests/runfiles/linux.run
tests/zfs-tests/tests/functional/pam/pam_change_unmounted.ksh [copied from tests/zfs-tests/tests/functional/pam/pam_short_password.ksh with 54% similarity]
tests/zfs-tests/tests/functional/pam/pam_short_password.ksh