patch-1.3.97 linux/fs/ext2/ioctl.c
Next file: linux/fs/super.c
Previous file: linux/drivers/sound/pss.c
Back to the patch index
Back to the overall index
- Lines: 44
- Date:
Sun Apr 28 11:28:10 1996
- Orig file:
v1.3.96/linux/fs/ext2/ioctl.c
- Orig date:
Wed Jan 17 07:31:58 1996
diff -u --recursive --new-file v1.3.96/linux/fs/ext2/ioctl.c linux/fs/ext2/ioctl.c
@@ -26,12 +26,16 @@
switch (cmd) {
case EXT2_IOC_GETFLAGS:
- if ((err = verify_area (VERIFY_WRITE, (long *) arg, sizeof(long))))
+ err = verify_area(VERIFY_WRITE, (int *) arg, sizeof(int));
+ if (err)
return err;
- put_fs_long (inode->u.ext2_i.i_flags, (long *) arg);
+ put_user(inode->u.ext2_i.i_flags, (int *) arg);
return 0;
case EXT2_IOC_SETFLAGS:
- flags = get_fs_long ((long *) arg);
+ err = verify_area(VERIFY_READ, (int *) arg, sizeof(int));
+ if (err)
+ return err;
+ flags = get_user((int *) arg);
/*
* The IMMUTABLE flag can only be changed by the super user
* when the security level is zero.
@@ -59,16 +63,20 @@
inode->i_dirt = 1;
return 0;
case EXT2_IOC_GETVERSION:
- if ((err = verify_area (VERIFY_WRITE, (long *) arg, sizeof(long))))
+ err = verify_area(VERIFY_WRITE, (int *) arg, sizeof(int));
+ if (err)
return err;
- put_fs_long (inode->u.ext2_i.i_version, (long *) arg);
+ put_user(inode->u.ext2_i.i_version, (int *) arg);
return 0;
case EXT2_IOC_SETVERSION:
if ((current->fsuid != inode->i_uid) && !fsuser())
return -EPERM;
if (IS_RDONLY(inode))
return -EROFS;
- inode->u.ext2_i.i_version = get_fs_long ((long *) arg);
+ err = verify_area(VERIFY_READ, (int *) arg, sizeof(int));
+ if (err)
+ return err;
+ inode->u.ext2_i.i_version = get_user((int *) arg);
inode->i_ctime = CURRENT_TIME;
inode->i_dirt = 1;
return 0;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this