summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2008-06-11 21:53:58 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:03 -0400
commitdf5b5520b21d8a2554ede65c09b288833c77144d (patch)
tree6f4e2876c263b0b359cd3bba92bbf80fe139064d /fs/btrfs/ioctl.c
parentf46b5a66b3316ef2f8febfe4c56e2d555e2c3979 (diff)
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 <hch@lst.de> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index da8de6cfdb5..6fb45580275 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;