Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issues with user.update endpoint
User may have nologin shell causing the attempt to run cp in a subprocess to fail due to failure to su to the user in question (due to error in pam_open_session()). After review of history for why we were subprocessing out to perform this task, I failed to find a compelling reason why we could not simply copy them without switching the user context. This commit adds a new `copytree` filesystem utility that provides the following features that are relevant to copying home directories. 1. ability to control behavior regarding whether the copy operation will walk into child datasets. Generally this is not desired because we have no design or provisions for creating child datasets within a user home directory. This situation is most likely to arise when users mistakenly set an incorrect path for a home directory, e.g. /mnt/tank/share rather than /mnt/tank/share/wilbur 2. awareness of various ACL types on TrueNAS. We need to rigidly preserve the permissions from the source when writing to a new destination in case the administrator made a configuration mistake like in (1) in order to avoid unintentional data disclosure. 3. awareness of the special .zfs directory. Some users enable snapdir visibility. This means that conventional copy methods can end up attempting to copy the entirety of the .zfs directory to a new path resulting in excessive time spent copying and space usage. 4. ability to use block cloning. This speeds up the actual data copy and reduces the amount of space used on the filesystem when the sysadmin changes a user home directory path.
- Loading branch information