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 Brian Behlendorf
parent 5846a85155
commit 04d991dbc4

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);