Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Aug 2014 05:05:11 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r269421 - head/sys/fs/nandfs
Message-ID:  <201408020505.s7255BZR035396@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Sat Aug  2 05:05:10 2014
New Revision: 269421
URL: http://svnweb.freebsd.org/changeset/base/269421

Log:
  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.

Modified:
  head/sys/fs/nandfs/nandfs_vnops.c

Modified: head/sys/fs/nandfs/nandfs_vnops.c
==============================================================================
--- head/sys/fs/nandfs/nandfs_vnops.c	Sat Aug  2 05:05:05 2014	(r269420)
+++ head/sys/fs/nandfs/nandfs_vnops.c	Sat Aug  2 05:05:10 2014	(r269421)
@@ -987,7 +987,7 @@ nandfs_check_possible(struct vnode *vp, 
 		 * 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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408020505.s7255BZR035396>