Kernel - fix access checks
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 26 Aug 2009 17:40:41 +0000 (10:40 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 26 Aug 2009 17:43:15 +0000 (10:43 -0700)
commitcb66845a55fd2b4f122f77e6dc648b44de8f4d74
treeba697255673235908242d033f79e0ac1578a85b6
parente900ae1d0b86d18886589224459dd6bd08a96f6b
Kernel - fix access checks

* VOP_ACCESS() is used for more then just access().  UFS and other
  filesystems (but not HAMMER) were calling it in the open/create/rename/
  unlink paths.  The uid/gid must be used in those cases, not the ruid/rgid.

  Add a VOP_EACCESS() macro which passes the appropriate flag to use the
  uid/gid instead of the ruid/rgid, and adjust the filesystems to use this
  macro.

Reported-by: Stathis Kamperis <ekamperi@gmail.com>
18 files changed:
sys/sys/vfsops.h
sys/vfs/gnu/ext2fs/ext2_lookup.c
sys/vfs/gnu/ext2fs/ext2_vfsops.c
sys/vfs/gnu/ext2fs/ext2_vnops.c
sys/vfs/hpfs/hpfs_vnops.c
sys/vfs/isofs/cd9660/cd9660_vfsops.c
sys/vfs/msdosfs/msdosfs_lookup.c
sys/vfs/msdosfs/msdosfs_vfsops.c
sys/vfs/msdosfs/msdosfs_vnops.c
sys/vfs/nfs/nfs_serv.c
sys/vfs/nwfs/nwfs_ioctl.c
sys/vfs/nwfs/nwfs_vnops.c
sys/vfs/smbfs/smbfs_vnops.c
sys/vfs/udf/udf_vfsops.c
sys/vfs/ufs/ffs_vfsops.c
sys/vfs/ufs/ufs_lookup.c
sys/vfs/ufs/ufs_vnops.c
sys/vfs/union/union_subr.c