From c7a0643d1cbea585773ab642582ec3f5e7fcc953 Mon Sep 17 00:00:00 2001 From: allanjude Date: Mon, 23 May 2016 15:11:01 +0000 Subject: Fix error in bsdinstall where additional filesystems cannot be mounted Do not set canmount=noauto on the boot environment at create time, because this causes / to not be mounted, and since the chroot is read only, new mountpoints cannot be created. The property is set later, when other properties are adjusted Reported by: HardenedBSD Sponsored by: ScaleEngine Inc. --- usr.sbin/bsdinstall/scripts/zfsboot | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'usr.sbin/bsdinstall') diff --git a/usr.sbin/bsdinstall/scripts/zfsboot b/usr.sbin/bsdinstall/scripts/zfsboot index b4b9f52..f191c55 100755 --- a/usr.sbin/bsdinstall/scripts/zfsboot +++ b/usr.sbin/bsdinstall/scripts/zfsboot @@ -143,7 +143,7 @@ f_isset ZFSBOOT_DATASETS || ZFSBOOT_DATASETS=" # Boot Environment [BE] root and default boot dataset /$ZFSBOOT_BEROOT_NAME mountpoint=none - /$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME mountpoint=/,canmount=noauto + /$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME mountpoint=/ # Compress /tmp, allow exec but not setuid /tmp mountpoint=/tmp,exec=on,setuid=off @@ -1310,6 +1310,10 @@ zfs_create_boot() "mountpoint=/$zroot_name" "$zroot_name" || return $FAILURE + f_dprintf "$funcname: Set canmount=noauto for the root of the pool..." + f_eval_catch $funcname zfs "$ZFS_SET" "canmount=noauto" \ + "$ZFSBOOT_BEROOT_NAME/$ZFSBOOT_BOOTFS_NAME" + # Touch up permissions on the tmp directories f_dprintf "$funcname: Modifying directory permissions..." local dir -- cgit v1.1