From: Christoph Hellwig Date: Thu, 12 Jun 2008 01:53:58 +0000 (-0400) Subject: BTRFS_IOC_TRANS_START should be privilegued X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=df5b5520b21d8a2554ede65c09b288833c77144d;p=openwrt%2Fstaging%2Fblogic.git BTRFS_IOC_TRANS_START should be privilegued As mentioned in the comment next to it btrfs_ioctl_trans_start can do bad damage to filesystems and thus should be limited to privilegued users. Signed-off-by: Christoph Hellwig Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index da8de6cfdb5a..6fb455802759 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -706,6 +706,9 @@ long btrfs_ioctl_trans_start(struct file *file) struct btrfs_trans_handle *trans; int ret = 0; + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + mutex_lock(&root->fs_info->fs_mutex); if (file->private_data) { ret = -EINPROGRESS;