From 3b207676966493f5897b60f1575ca81297373eb4 Mon Sep 17 00:00:00 2001 From: kib Date: Tue, 24 Jun 2014 08:21:43 +0000 Subject: MFC r267564: In msdosfs_setattr(), add a check for result of the utimes(2) permissions test. Refactor the permission checks for utimes(2). --- sys/fs/devfs/devfs_vnops.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sys/fs/devfs/devfs_vnops.c') diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index a05299a..1e3f5e8 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -1533,10 +1533,8 @@ devfs_setattr(struct vop_setattr_args *ap) } if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) { - /* See the comment in ufs_vnops::ufs_setattr(). */ - if ((error = VOP_ACCESS(vp, VADMIN, ap->a_cred, td)) && - ((vap->va_vaflags & VA_UTIMES_NULL) == 0 || - (error = VOP_ACCESS(vp, VWRITE, ap->a_cred, td)))) + error = vn_utimes_perm(vp, vap, ap->a_cred, td); + if (error != 0) return (error); if (vap->va_atime.tv_sec != VNOVAL) { if (vp->v_type == VCHR) -- cgit v1.1