Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/shaggy/jfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6:
  JFS: Remove redundant xattr permission checking
  • Loading branch information
Linus Torvalds committed Nov 4, 2006
2 parents a0d2db2 + d572b87 commit aaa9b97
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions fs/jfs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,11 @@ static int can_set_system_xattr(struct inode *inode, const char *name,
return -EOPNOTSUPP;
}

/*
* Most of the permission checking is done by xattr_permission in the vfs.
* The local file system is responsible for handling the system.* namespace.
* We also need to verify that this is a namespace that we recognize.
*/
static int can_set_xattr(struct inode *inode, const char *name,
const void *value, size_t value_len)
{
Expand All @@ -771,10 +776,6 @@ static int can_set_xattr(struct inode *inode, const char *name,
strncmp(name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN))
return -EOPNOTSUPP;

if (!S_ISREG(inode->i_mode) &&
(!S_ISDIR(inode->i_mode) || inode->i_mode &S_ISVTX))
return -EPERM;

return 0;
}

Expand Down

0 comments on commit aaa9b97

Please sign in to comment.