HomeFreeBSD

pw userdel: destroy home dataset if empty

Description

pw userdel: destroy home dataset if empty

When removing a user's home directory, if the directory is a ZFS
dataset, it cannot be removed. If the directory has been emptied,
use "zfs destroy" to destroy it. This complements the automatic
dataset creation in adduser. Note that datasets within the directory
and snapshots are not handled, as the complete path is not constructed.

While here, add waitpid() calls to rmat() and pw_user_del().

Reviewed by: des
Differential Revision: https://reviews.freebsd.org/D45348

(cherry picked from commit d2f1f71ec8c62dd26d6169d0d671a5aa5a933c1a)

Details

Provenance
karelsAuthored on May 29 2024, 11:55 PM
desCommitted on Aug 21 2024, 10:31 AM
Reviewer
des
Differential Revision
D45348: pw userdel: destroy home dataset if empty
Parents
rG8398c81b7c28: adduser: Better document ZFS dataset creation.
Branches
Unknown
Tags
Unknown