Christoph Hellwig
2008-Jun-10 16:20 UTC
[PATCH] btrfs: 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>
Index: btrfs-unstable/ioctl.c
==================================================================---
btrfs-unstable.orig/ioctl.c 2008-06-10 18:17:00.000000000 +0200
+++ btrfs-unstable/ioctl.c 2008-06-10 18:17:57.000000000 +0200
@@ -706,6 +706,9 @@ long btrfs_ioctl_trans_start(struct 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;
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs"
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html