Update pam_zfs_key.c defaultt path for FreeBSD

As described in https://github.com/freebsd/freebsd-src/pull/1305,
FreeBSD's installer defaults to zroot/home for user home directories.

For FreeBSD only, set the default prefix for pam_zfs_key to match.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Signed-off-by: Eric A. Borisch <eborisch@gmail.com>
Closes #17600
This commit is contained in:
Eric A. Borisch 2025-08-27 11:36:37 -05:00 committed by GitHub
parent 976f765341
commit 1da2c30bed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -391,7 +391,11 @@ static int
zfs_key_config_load(pam_handle_t *pamh, zfs_key_config_t *config,
int argc, const char **argv)
{
#if defined(__FreeBSD__)
config->homes_prefix = strdup("zroot/home");
#else
config->homes_prefix = strdup("rpool/home");
#endif
if (config->homes_prefix == NULL) {
pam_syslog(pamh, LOG_ERR, "strdup failure");
return (PAM_SERVICE_ERR);