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)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 4 May 2009 06:22:03 +0000 (23:22 -0700)
commite1b4bb122782281c31efd0cdb5e41b94af947ccb
treec70c1aba0a77256bc8ca494c5a46d2172bad6aa7
parent778963124b94d3f75cd6ace4556026708b1006b7
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