X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=fs%2Fjfs%2Fioctl.c;h=dfda12a073e1985fb28b798df2e9088a9a996be4;hb=c64768a7d671bcde80bca2aed93f9e07edc069c3;hp=fe063af6fd2fb216538d6c4bb0cc82e7ba024d2a;hpb=0b662c64840fb281e5948ab6f9d60f84817277d0;p=~andy%2Flinux diff --git a/fs/jfs/ioctl.c b/fs/jfs/ioctl.c index fe063af6fd2..dfda12a073e 100644 --- a/fs/jfs/ioctl.c +++ b/fs/jfs/ioctl.c @@ -69,7 +69,7 @@ int jfs_ioctl(struct inode * inode, struct file * filp, unsigned int cmd, if (IS_RDONLY(inode)) return -EROFS; - if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER)) + if (!is_owner_or_cap(inode)) return -EACCES; if (get_user(flags, (int __user *) arg)) @@ -79,6 +79,9 @@ int jfs_ioctl(struct inode * inode, struct file * filp, unsigned int cmd, if (!S_ISDIR(inode->i_mode)) flags &= ~JFS_DIRSYNC_FL; + /* Is it quota file? Do not allow user to mess with it */ + if (IS_NOQUOTA(inode)) + return -EPERM; jfs_get_inode_flags(jfs_inode); oldflags = jfs_inode->mode2;