Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 17557
b: refs/heads/master
c: 267fd05
h: refs/heads/master
i:
  17555: cacd40c
v: v3
  • Loading branch information
akpm@osdl.org authored and Linus Torvalds committed Jan 10, 2006
1 parent 76fafdc commit 04cfcb3
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 44a0033f6d5f3e7e2fc37d7b44a1d105c70d4682
refs/heads/master: 267fd05791aafea3786494365a5d13d7923ef526
4 changes: 0 additions & 4 deletions trunk/fs/ext2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,6 @@ ext2_xattr_set(struct inode *inode, int name_index, const char *name,
ea_idebug(inode, "name=%d.%s, value=%p, value_len=%ld",
name_index, name, value, (long)value_len);

if (IS_RDONLY(inode))
return -EROFS;
if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
return -EPERM;
if (value == NULL)
value_len = 0;
if (name == NULL)
Expand Down
4 changes: 0 additions & 4 deletions trunk/fs/ext2/xattr_trusted.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ ext2_xattr_trusted_get(struct inode *inode, const char *name,
{
if (strcmp(name, "") == 0)
return -EINVAL;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
return ext2_xattr_get(inode, EXT2_XATTR_INDEX_TRUSTED, name,
buffer, size);
}
Expand All @@ -50,8 +48,6 @@ ext2_xattr_trusted_set(struct inode *inode, const char *name,
{
if (strcmp(name, "") == 0)
return -EINVAL;
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
return ext2_xattr_set(inode, EXT2_XATTR_INDEX_TRUSTED, name,
value, size, flags);
}
Expand Down
14 changes: 0 additions & 14 deletions trunk/fs/ext2/xattr_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,35 +35,21 @@ static int
ext2_xattr_user_get(struct inode *inode, const char *name,
void *buffer, size_t size)
{
int error;

if (strcmp(name, "") == 0)
return -EINVAL;
if (!test_opt(inode->i_sb, XATTR_USER))
return -EOPNOTSUPP;
error = permission(inode, MAY_READ, NULL);
if (error)
return error;

return ext2_xattr_get(inode, EXT2_XATTR_INDEX_USER, name, buffer, size);
}

static int
ext2_xattr_user_set(struct inode *inode, const char *name,
const void *value, size_t size, int flags)
{
int error;

if (strcmp(name, "") == 0)
return -EINVAL;
if (!test_opt(inode->i_sb, XATTR_USER))
return -EOPNOTSUPP;
if ( !S_ISREG(inode->i_mode) &&
(!S_ISDIR(inode->i_mode) || inode->i_mode & S_ISVTX))
return -EPERM;
error = permission(inode, MAY_WRITE, NULL);
if (error)
return error;

return ext2_xattr_set(inode, EXT2_XATTR_INDEX_USER, name,
value, size, flags);
Expand Down

0 comments on commit 04cfcb3

Please sign in to comment.