adduser(8): support creation of ZFS dataset
On systems utilizing ZFS, default to creating a ZFS dataset for a new user's home directory if the parent directory resides on a ZFS dataset. Add a flag that disables this behavior if the administrator explicitly does not want it.
If run during installation from within a chroot, set mountpoint to legacy after dataset creation and mount directly into the chroot. Then umount and reset the mountpoint to inherit from parent.
Also support ZFS default encryption on user's home directory.
Requested here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263234
Failed to start an instance: FAILED_PRECONDITION: Monthly compute limit exceeded!
Whoops. Maybe resubmit in a few hours? 😅
I simplified the code with your suggestions @delphij. This revision just adds a dataset if the parent resides on a dataset like you mentioned. I'll get to work on adding encryption in a later revision. Thanks again!
Discovered bug during installation in chrooted environment. The skeleton data for the user's home directory is copied into the underlying user directory instead of the mounted dataset. Marking this draft until I resolve the issue.
I think this LGTM- thanks!
Thanks Kyle!
@kevans91 and go ahead and commit this?
Just a nit an a quick question
merged. Thanks!