]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: allow subvol deletion by unprivileged user with -o user_subvol_rm_allowed
authorSage Weil <sage@newdream.net>
Fri, 29 Oct 2010 19:46:43 +0000 (15:46 -0400)
committerChris Mason <chris.mason@oracle.com>
Sat, 30 Oct 2010 01:42:10 +0000 (21:42 -0400)
commit9cd13d0e57667ebb9d9833029a47ae6617001a28
tree7feb5ab81d074b17a7c5b12bcc019c2e1bb010e2
parentb1124ed3b06c87a7cb9b0629870115785e9f9115
Btrfs: allow subvol deletion by unprivileged user with -o user_subvol_rm_allowed

Add a mount option user_subvol_rm_allowed that allows users to delete a
(potentially non-empty!) subvol when they would otherwise we allowed to do
an rmdir(2).  We duplicate the may_delete() checks from the core VFS code
to implement identical security checks (minus the directory size check).
We additionally require that the user has write+exec permission on the
subvol root inode.

Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ctree.h
fs/btrfs/ioctl.c
fs/btrfs/super.c