]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
BTRFS_IOC_TRANS_START should be privilegued
authorChristoph Hellwig <hch@lst.de>
Thu, 12 Jun 2008 01:53:58 +0000 (21:53 -0400)
committerChris Mason <chris.mason@oracle.com>
Thu, 25 Sep 2008 15:04:03 +0000 (11:04 -0400)
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>
fs/btrfs/ioctl.c

index da8de6cfdb5a3eb9ae7451f221e3f134e18a878e..6fb455802759ea268b2e2c0e9ce46e24a595e7cc 100644 (file)
@@ -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;