summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2005-06-29 18:52:28 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-29 21:02:04 -0700
commit869eb76e7b60ebd8f87a358b72e97fa0aef1d1f5 (patch)
tree6c78a8f32c1e18286f9815f3077e454cca766bc0 /fs
parent0b35ff23b2633eb996d666e5a49a5d49b8a6a2d3 (diff)
[PATCH] reiserfs: Check if attrs are enabled for attr ioctls
ReiserFS currently will allow the user to set/get attrs for files regardless if they are enabled. The patch checks to see if they are enabled, and returns -NOTTY if they are not. ext[23] doesn't need this check because attrs are always enabled. Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/reiserfs/ioctl.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/reiserfs/ioctl.c b/fs/reiserfs/ioctl.c
index 94dc42475a04..76caedf737f2 100644
--- a/fs/reiserfs/ioctl.c
+++ b/fs/reiserfs/ioctl.c
@@ -36,10 +36,16 @@ int reiserfs_ioctl (struct inode * inode, struct file * filp, unsigned int cmd,
/* following two cases are taken from fs/ext2/ioctl.c by Remy
Card (card@masi.ibp.fr) */
case REISERFS_IOC_GETFLAGS:
+ if (!reiserfs_attrs (inode->i_sb))
+ return -ENOTTY;
+
flags = REISERFS_I(inode) -> i_attrs;
i_attrs_to_sd_attrs( inode, ( __u16 * ) &flags );
return put_user(flags, (int __user *) arg);
case REISERFS_IOC_SETFLAGS: {
+ if (!reiserfs_attrs (inode->i_sb))
+ return -ENOTTY;
+
if (IS_RDONLY(inode))
return -EROFS;