linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/8] remove ext2 xattr permission checks
@ 2005-11-01  2:30 Christoph Hellwig
  0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2005-11-01  2:30 UTC (permalink / raw)
  To: akpm; +Cc: linux-fsdevel

remove checks now in the VFS


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6/fs/ext2/xattr.c
===================================================================
--- linux-2.6.orig/fs/ext2/xattr.c	2005-10-30 19:54:21.000000000 +0100
+++ linux-2.6/fs/ext2/xattr.c	2005-10-30 19:55:57.000000000 +0100
@@ -389,10 +389,6 @@
 	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)
Index: linux-2.6/fs/ext2/xattr_trusted.c
===================================================================
--- linux-2.6.orig/fs/ext2/xattr_trusted.c	2005-10-30 19:54:21.000000000 +0100
+++ linux-2.6/fs/ext2/xattr_trusted.c	2005-10-30 19:55:25.000000000 +0100
@@ -38,8 +38,6 @@
 {
 	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);
 }
@@ -50,8 +48,6 @@
 {
 	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);
 }
Index: linux-2.6/fs/ext2/xattr_user.c
===================================================================
--- linux-2.6.orig/fs/ext2/xattr_user.c	2005-10-30 19:54:21.000000000 +0100
+++ linux-2.6/fs/ext2/xattr_user.c	2005-10-30 19:55:51.000000000 +0100
@@ -41,10 +41,6 @@
 		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);
 }
 
@@ -58,12 +54,6 @@
 		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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-11-01  2:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-01  2:30 [PATCH 4/8] remove ext2 xattr permission checks Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).