[PATCH] reiserfs: Check if attrs are enabled for attr ioctls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 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.

 Please apply.

Signed-off-by: Jeff Mahoney <[email protected]>
 
diff -ruNpX dontdiff linux-2.6.12-rc6/fs/reiserfs/ioctl.c linux-2.6.12-rc6.devel/fs/reiserfs/ioctl.c
--- linux-2.6.12-rc6/fs/reiserfs/ioctl.c	2005-06-13 14:34:32.000000000 -0400
+++ linux-2.6.12-rc6.devel/fs/reiserfs/ioctl.c	2005-06-22 17:30:40.000000000 -0400
@@ -34,10 +34,16 @@ int reiserfs_ioctl (struct inode * inode
 	/* following two cases are taken from fs/ext2/ioctl.c by Remy
 	   Card ([email protected]) */
 	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;
 
-- 
Jeff Mahoney
SuSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux