diff options
Diffstat (limited to 'fs/btrfs/acl.c')
-rw-r--r-- | fs/btrfs/acl.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 8d432cd9d580..2222d161c7b6 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c | |||
@@ -60,6 +60,8 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type) | |||
60 | size = __btrfs_getxattr(inode, name, value, size); | 60 | size = __btrfs_getxattr(inode, name, value, size); |
61 | if (size > 0) { | 61 | if (size > 0) { |
62 | acl = posix_acl_from_xattr(value, size); | 62 | acl = posix_acl_from_xattr(value, size); |
63 | if (IS_ERR(acl)) | ||
64 | return acl; | ||
63 | set_cached_acl(inode, type, acl); | 65 | set_cached_acl(inode, type, acl); |
64 | } | 66 | } |
65 | kfree(value); | 67 | kfree(value); |
@@ -160,6 +162,12 @@ static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name, | |||
160 | int ret; | 162 | int ret; |
161 | struct posix_acl *acl = NULL; | 163 | struct posix_acl *acl = NULL; |
162 | 164 | ||
165 | if (!is_owner_or_cap(dentry->d_inode)) | ||
166 | return -EPERM; | ||
167 | |||
168 | if (!IS_POSIXACL(dentry->d_inode)) | ||
169 | return -EOPNOTSUPP; | ||
170 | |||
163 | if (value) { | 171 | if (value) { |
164 | acl = posix_acl_from_xattr(value, size); | 172 | acl = posix_acl_from_xattr(value, size); |
165 | if (acl == NULL) { | 173 | if (acl == NULL) { |