diff options
author | kib <kib@FreeBSD.org> | 2014-06-24 08:21:43 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2014-06-24 08:21:43 +0000 |
commit | 3b207676966493f5897b60f1575ca81297373eb4 (patch) | |
tree | 245675f195f5eed0fb417672371ef12b73f813c6 /sys/fs/devfs | |
parent | cf140f008f5d28d6463422c17af1c4a6013dd0d6 (diff) | |
download | FreeBSD-src-3b207676966493f5897b60f1575ca81297373eb4.zip FreeBSD-src-3b207676966493f5897b60f1575ca81297373eb4.tar.gz |
MFC r267564:
In msdosfs_setattr(), add a check for result of the utimes(2) permissions test.
Refactor the permission checks for utimes(2).
Diffstat (limited to 'sys/fs/devfs')
-rw-r--r-- | sys/fs/devfs/devfs_vnops.c | 6 |
1 files changed, 2 insertions, 4 deletions
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) |