svn commit: r233875 - head/sys/ufs/ufs

Jaakko Heinonen jh at FreeBSD.org
Wed Apr 4 14:50:22 UTC 2012


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);
 		/*


More information about the svn-src-all mailing list