Skip to content

Commit

Permalink
[PATCH] reiserfs: Check if attrs are enabled for attr ioctls
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff Mahoney authored and Linus Torvalds committed Jun 30, 2005
1 parent 0b35ff2 commit 869eb76
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/reiserfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 869eb76

Please sign in to comment.