diff mbox

btrfs: should add a permission check for setfacl

Message ID 4BF1E458.7060500@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shi Weihua May 18, 2010, 12:50 a.m. UTC
None
diff mbox

Patch

diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
index da3133c..12d7be8 100644
--- a/fs/btrfs/acl.c
+++ b/fs/btrfs/acl.c
@@ -159,6 +159,9 @@  static int btrfs_xattr_set_acl(struct inode *inode, int type,
 	int ret;
 	struct posix_acl *acl = NULL;
 
+	if (!is_owner_or_cap(inode))
+		return -EPERM;
+
 	if (value) {
 		acl = posix_acl_from_xattr(value, size);
 		if (acl == NULL) {