[PATCH] remove ext3 xattr permission checks
authorakpm@osdl.org <akpm@osdl.org>
Tue, 10 Jan 2006 04:51:58 +0000 (20:51 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 10 Jan 2006 16:01:30 +0000 (08:01 -0800)
\r)

From: Christoph Hellwig <hch@lst.de>

remove checks now in the VFS

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/ext3/xattr.c
fs/ext3/xattr_trusted.c
fs/ext3/xattr_user.c

index 238199d82ce547791aa735665f1741ab99c3a573..e8d60bf6b7df7b6bc964eccc2046d72dd5c0064e 100644 (file)
@@ -946,10 +946,6 @@ ext3_xattr_set_handle(handle_t *handle, struct inode *inode, int name_index,
        };
        int error;
 
-       if (IS_RDONLY(inode))
-               return -EROFS;
-       if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
-               return -EPERM;
        if (!name)
                return -EINVAL;
        if (strlen(name) > 255)
index f68bfd1cf519f6f55d24fcd5728e2d442ba18440..7c693c94f14d8eb7e070e2bc74ad1ce4a92e7bcc 100644 (file)
@@ -39,8 +39,6 @@ ext3_xattr_trusted_get(struct inode *inode, const char *name,
 {
        if (strcmp(name, "") == 0)
                return -EINVAL;
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
        return ext3_xattr_get(inode, EXT3_XATTR_INDEX_TRUSTED, name,
                              buffer, size);
 }
@@ -51,8 +49,6 @@ ext3_xattr_trusted_set(struct inode *inode, const char *name,
 {
        if (strcmp(name, "") == 0)
                return -EINVAL;
-       if (!capable(CAP_SYS_ADMIN))
-               return -EPERM;
        return ext3_xattr_set(inode, EXT3_XATTR_INDEX_TRUSTED, name,
                              value, size, flags);
 }
index e907cae7a07c34617983bf808125e1a526235801..a85a0a17c4fd4bc8d5981f9da79d48289876e1ad 100644 (file)
@@ -37,16 +37,10 @@ static int
 ext3_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 ext3_xattr_get(inode, EXT3_XATTR_INDEX_USER, name, buffer, size);
 }
 
@@ -54,19 +48,10 @@ static int
 ext3_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 ext3_xattr_set(inode, EXT3_XATTR_INDEX_USER, name,
                              value, size, flags);
 }