Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Apr 2012 14:50:22 +0000 (UTC)
From:      Jaakko Heinonen <jh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r233875 - head/sys/ufs/ufs
Message-ID:  <201204041450.q34EoMP7008742@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jh
Date: Wed Apr  4 14:50:21 2012
New Revision: 233875
URL: http://svn.freebsd.org/changeset/base/233875

Log:
  Add a check for unsupported file flags to ufs_setattr().
  
  Discussed with:	bde
  MFC after:	2 weeks

Modified:
  head/sys/ufs/ufs/ufs_vnops.c

Modified: head/sys/ufs/ufs/ufs_vnops.c
==============================================================================
--- head/sys/ufs/ufs/ufs_vnops.c	Wed Apr  4 14:47:59 2012	(r233874)
+++ head/sys/ufs/ufs/ufs_vnops.c	Wed Apr  4 14:50:21 2012	(r233875)
@@ -526,6 +526,10 @@ ufs_setattr(ap)
 		return (EINVAL);
 	}
 	if (vap->va_flags != VNOVAL) {
+		if ((vap->va_flags & ~(UF_NODUMP | UF_IMMUTABLE | UF_APPEND |
+		    UF_OPAQUE | UF_NOUNLINK | SF_ARCHIVED | SF_IMMUTABLE |
+		    SF_APPEND | SF_NOUNLINK | SF_SNAPSHOT)) != 0)
+			return (EOPNOTSUPP);
 		if (vp->v_mount->mnt_flag & MNT_RDONLY)
 			return (EROFS);
 		/*



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