HomeFreeBSD

adduser: create dataset only if home is directly within dataset

Description

adduser: create dataset only if home is directly within dataset

Currently, if the prefix of the new home directory is a subdirectory
of a ZFS dataset, adduser will create a new dataset up one or more
levels from the intended destination. "pw useradd" will then create
a normal directory in the desired location, leaving an unused dataset.
Check for this situation when determining whether to create a dataset,
and let pw create the directory.

Reviewed by: des
Differential Revision: https://reviews.freebsd.org/D45229
MFC after: 3 days
Approved by: re (cperciva)

(cherry picked from commit 0b39b2e2ddb2df1d1325e042893ddcb1a1c12b8e)
(cherry picked from commit da384ffbd5adebd7079b4dadd2592e82232566e0)

Details

Provenance
karelsAuthored on May 20 2024, 1:43 PM
desCommitted on Aug 21 2024, 5:13 PM
Parents
rG9b945635c147: tail -F: fix crash
Branches
Unknown
Tags
Unknown