]> granicus.if.org Git - shadow/commit
Add support for btrfs subvolumes for user homes
authorAdam Majer <amajer@suse.de>
Mon, 21 Jan 2019 08:32:36 +0000 (09:32 +0100)
committerSerge Hallyn <shallyn@cisco.com>
Sat, 4 May 2019 05:38:23 +0000 (22:38 -0700)
commitc1d36a8acb1d5fbe42099a37c8ed6f33e8a648e6
tree384346ce5f5bfab524a49cffc1a30ce99b77ce3e
parentcaefe9e8ded684f5f82a813de899c4a4ccc4789e
Add support for btrfs subvolumes for user homes

new switch added to useradd command, --btrfs-subvolume-home. When
specified *and* the filesystem is detected as btrfs, it will create a
subvolume for user's home instead of a plain directory. This is done via
`btrfs subvolume` command.  Specifying the new switch while trying to
create home on non-btrfs will result in an error.

userdel -r will handle and remove this subvolume transparently via
`btrfs subvolume` command. Previosuly this failed as you can't rmdir a
subvolume.

usermod, when moving user's home across devices, will detect if the home
is a subvolume and issue an error messages instead of copying it. Moving
user's home (as subvolume) on same btrfs works transparently.
lib/prototypes.h
libmisc/Makefile.am
libmisc/btrfs.c [new file with mode: 0644]
src/useradd.c
src/userdel.c
src/usermod.c