1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

Fix "echo > /dev/null" for non-root users which broke in previous commit.

This commit is contained in:
Poul-Henning Kamp 2001-11-04 19:12:59 +00:00
parent 6b8bd2efc1
commit d018a84cbc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=86040

View File

@ -698,11 +698,13 @@ devfs_setattr(ap)
c = 1;
}
/* see comment in ufs_vnops::ufs_setattr() */
if ((error = VOP_ACCESS(vp, VADMIN, ap->a_cred, ap->a_td)) &&
((vap->va_vaflags & VA_UTIMES_NULL) == 0 ||
(error = VOP_ACCESS(vp, VWRITE, ap->a_cred, ap->a_td))))
return (error);
if (vap->va_atime.tv_sec != VNOVAL || vap->va_mtime.tv_sec != VNOVAL) {
/* see comment in ufs_vnops::ufs_setattr() */
if ((error = VOP_ACCESS(vp, VADMIN, ap->a_cred, ap->a_td)) &&
((vap->va_vaflags & VA_UTIMES_NULL) == 0 ||
(error = VOP_ACCESS(vp, VWRITE, ap->a_cred, ap->a_td))))
return (error);
}
if (vap->va_mode != (mode_t)VNOVAL) {
if ((ap->a_cred->cr_uid != de->de_uid) &&