freebsd-src icon indicating copy to clipboard operation
freebsd-src copied to clipboard

adduser(8): support creation of ZFS dataset

Open jgrafton opened this issue 2 years ago • 6 comments

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

jgrafton avatar Oct 31 '23 17:10 jgrafton

Failed to start an instance: FAILED_PRECONDITION: Monthly compute limit exceeded!

Whoops. Maybe resubmit in a few hours? 😅

no-usernames-left avatar Oct 31 '23 17:10 no-usernames-left

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!

jgrafton avatar Nov 01 '23 21:11 jgrafton

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.

jgrafton avatar Nov 08 '23 13:11 jgrafton

I think this LGTM- thanks!

Thanks Kyle!

jgrafton avatar Jan 02 '24 03:01 jgrafton

@kevans91 and go ahead and commit this?

igalic avatar Jan 16 '24 13:01 igalic

Just a nit an a quick question

bsdimp avatar Jan 17 '24 16:01 bsdimp

merged. Thanks!

bsdimp avatar Apr 11 '24 18:04 bsdimp