Fix permissions check for utimes() - owner can call even if u-w.
authorMatt Dillon <dillon@test29.backplane.com>
Thu, 2 Apr 2009 03:56:49 +0000 (03:56 +0000)
committerMatt Dillon <dillon@test29.backplane.com>
Thu, 2 Apr 2009 03:56:49 +0000 (03:56 +0000)
commitee89633d5330733056052c06919a5dd4c01347bc
treec387f0d4b0d7fc7927b98841a5f6a330d0310104
parentf741dc5a636b43a56495cdb8c8a91aa4488ec3f9
Fix permissions check for utimes() - owner can call even if u-w.

The owner of a file can call utimes() to modify the file's access and
modified times even if the file is not user-writable.  Add a VOWN test
for VOP_ACCESS() / naccess() which performs this check.

As far as I know only kern_utimes() needs to use this particular type
of test.

This also fixes issues with cp -p and a few other programs.

Reported-by: Johannes Hofmann <johannes.hofmann@gmx.de>
12 files changed:
sys/kern/vfs_helper.c
sys/kern/vfs_nlookup.c
sys/kern/vfs_syscalls.c
sys/sys/vnode.h
sys/vfs/gnu/ext2fs/ext2_vnops.c
sys/vfs/hpfs/hpfs_vnops.c
sys/vfs/msdosfs/msdosfs_vnops.c
sys/vfs/ntfs/ntfs_vnops.c
sys/vfs/nwfs/nwfs_vnops.c
sys/vfs/smbfs/smbfs_vnops.c
sys/vfs/udf/udf_vnops.c
sys/vfs/ufs/ufs_vnops.c