diff options
Diffstat (limited to 'drivers/block/paride/pd.c')
-rw-r--r-- | drivers/block/paride/pd.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c index aa431ae33..c2f9473bc 100644 --- a/drivers/block/paride/pd.c +++ b/drivers/block/paride/pd.c @@ -466,7 +466,7 @@ static int pd_ioctl(struct inode *inode,struct file *file, 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 @@ static int pd_ioctl(struct inode *inode,struct file *file, 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: |