X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fjfs%2Fioctl.c;fp=fs%2Fjfs%2Fioctl.c;h=a0020c33e0475efd865a01a6a88a654e8cbe0818;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=67b3774820eb663086675ef4a057066e56e93e94;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/fs/jfs/ioctl.c b/fs/jfs/ioctl.c index 67b377482..a0020c33e 100644 --- a/fs/jfs/ioctl.c +++ b/fs/jfs/ioctl.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -65,7 +66,8 @@ int jfs_ioctl(struct inode * inode, struct file * filp, unsigned int cmd, case JFS_IOC_SETFLAGS: { unsigned int oldflags; - if (IS_RDONLY(inode)) + if (IS_RDONLY(inode) || + (filp && MNT_IS_RDONLY(filp->f_vfsmnt))) return -EROFS; if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER)) @@ -85,8 +87,8 @@ int jfs_ioctl(struct inode * inode, struct file * filp, unsigned int cmd, * the relevant capability. */ if ((oldflags & JFS_IMMUTABLE_FL) || - ((flags ^ oldflags) & - (JFS_APPEND_FL | JFS_IMMUTABLE_FL))) { + ((flags ^ oldflags) & (JFS_APPEND_FL | + JFS_IMMUTABLE_FL | JFS_IUNLINK_FL))) { if (!capable(CAP_LINUX_IMMUTABLE)) return -EPERM; }