diff options
author | imp <imp@FreeBSD.org> | 2014-08-02 05:05:10 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2014-08-02 05:05:10 +0000 |
commit | 30d213fa5db75c49893be226abf670356bb04d72 (patch) | |
tree | 5283ae83d59d9ea09b21d47aad882fb0987e4374 /sys/fs/nandfs/nandfs_vnops.c | |
parent | 57758616d25fc90197378c24142d99997d9e2162 (diff) | |
download | FreeBSD-src-30d213fa5db75c49893be226abf670356bb04d72.zip FreeBSD-src-30d213fa5db75c49893be226abf670356bb04d72.tar.gz |
Follow the ufs practice for disallowing permission changes as well as
writes to files for read-only file systems. Since there are already
checks in nandfs_setattr that return an error, this moves detection of
the error earlier.
Diffstat (limited to 'sys/fs/nandfs/nandfs_vnops.c')
-rw-r--r-- | sys/fs/nandfs/nandfs_vnops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/nandfs/nandfs_vnops.c b/sys/fs/nandfs/nandfs_vnops.c index e36aea3..2c92f8b 100644 --- a/sys/fs/nandfs/nandfs_vnops.c +++ b/sys/fs/nandfs/nandfs_vnops.c @@ -987,7 +987,7 @@ nandfs_check_possible(struct vnode *vp, struct vattr *vap, mode_t mode) * Normal nodes: check if we're on a read-only mounted * filingsystem and bomb out if we're trying to write. */ - if ((mode & VWRITE) && (vp->v_mount->mnt_flag & MNT_RDONLY)) + if ((mode & VMODIFY_PERMS) && (vp->v_mount->mnt_flag & MNT_RDONLY)) return (EROFS); break; case VBLK: |