patch-2.1.100 linux/drivers/scsi/sd_ioctl.c

Next file: linux/drivers/scsi/sr_ioctl.c
Previous file: linux/drivers/scsi/sd.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.99/linux/drivers/scsi/sd_ioctl.c linux/drivers/scsi/sd_ioctl.c
@@ -79,7 +79,7 @@
 	return 0;
 
     case BLKRASET:
-	if (!suser())
+	if (!capable(CAP_SYS_ADMIN))
 		return -EACCES;
 	if(!(inode->i_rdev)) return -EINVAL;
 	if(arg > 0xff) return -EINVAL;
@@ -96,13 +96,15 @@
 	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: /* Re-read partition tables */
+        if (!capable(CAP_SYS_ADMIN))
+                return -EACCES;
 	return revalidate_scsidisk(dev, 1);
 
     RO_IOCTLS(dev, arg);

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