patch-2.1.100 linux/drivers/block/paride/pd.c

Next file: linux/drivers/block/paride/pf.c
Previous file: linux/drivers/block/opti621.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.99/linux/drivers/block/paride/pd.c linux/drivers/block/paride/pd.c
@@ -466,7 +466,7 @@
                 put_user(pd_hd[dev].start_sect,(long *)&geo->start);
                 return 0;
             case BLKRASET:
-                if(!suser()) return -EACCES;
+                if(!capable(CAP_SYS_ADMIN)) return -EACCES;
                 if(!(inode->i_rdev)) return -EINVAL;
                 if(arg > 0xff) return -EINVAL;
                 read_ahead[MAJOR(inode->i_rdev)] = arg;
@@ -484,12 +484,14 @@
                 put_user(pd_hd[dev].nr_sects,(long *) arg);
                 return (0);
             case BLKFLSBUF:
-                if(!suser())  return -EACCES;
+                if(!capable(CAP_SYS_ADMIN))  return -EACCES;
                 if(!(inode->i_rdev)) return -EINVAL;
                 fsync_dev(inode->i_rdev);
                 invalidate_buffers(inode->i_rdev);
                 return 0;
             case BLKRRPART:
+		if (!capable(CAP_SYS_ADMIN))
+			return -EACCES;
                 return pd_revalidate(inode->i_rdev);
             RO_IOCTLS(inode->i_rdev,arg);
             default:

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov