Skip to content

Commit

Permalink
BTRFS_IOC_TRANS_START should be privilegued
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig authored and Chris Mason committed Sep 25, 2008
1 parent f46b5a6 commit df5b552
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit df5b552

Please sign in to comment.