dect
/
linux-2.6
Archived
13
0
Fork 0

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>
This commit is contained in:
Christoph Hellwig 2008-06-11 21:53:58 -04:00 committed by Chris Mason
parent f46b5a66b3
commit df5b5520b2
1 changed files with 3 additions and 0 deletions

View 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;