Index: share/man/man9/vaccess.9 =================================================================== --- share/man/man9/vaccess.9 (revision 183742) +++ share/man/man9/vaccess.9 (working copy) @@ -40,7 +40,7 @@ .Fa "mode_t file_mode" .Fa "uid_t file_uid" .Fa "gid_t file_gid" -.Fa "mode_t acc_mode" +.Fa "vaccess_t acc_mode" .Fa "struct ucred *cred" .Fa "int *privused" .Fc Index: share/man/man9/VOP_ACCESS.9 =================================================================== --- share/man/man9/VOP_ACCESS.9 (revision 183742) +++ share/man/man9/VOP_ACCESS.9 (working copy) @@ -39,7 +39,7 @@ .In sys/param.h .In sys/vnode.h .Ft int -.Fn VOP_ACCESS "struct vnode *vp" "int mode" "struct ucred *cred" "struct thread *td" +.Fn VOP_ACCESS "struct vnode *vp" "vaccess_t mode" "struct ucred *cred" "struct thread *td" .Sh DESCRIPTION This entry point checks the access permissions of the file against the given credentials. @@ -58,7 +58,7 @@ .Pp The .Fa mode -is a mask which can contain +is a mask which can contain flags described in , e.g. .Dv VREAD , .Dv VWRITE or @@ -71,7 +71,7 @@ .Sh PSEUDOCODE .Bd -literal int -vop_access(struct vnode *vp, int mode, struct ucred *cred, struct thread *td) +vop_access(struct vnode *vp, vaccess_t mode, struct ucred *cred, struct thread *td) { int error; Index: share/man/man9/vaccess_acl_posix1e.9 =================================================================== --- share/man/man9/vaccess_acl_posix1e.9 (revision 183742) +++ share/man/man9/vaccess_acl_posix1e.9 (working copy) @@ -41,7 +41,7 @@ .Fa "uid_t file_uid" .Fa "gid_t file_gid" .Fa "struct acl *acl" -.Fa "mode_t acc_mode" +.Fa "vaccess_t acc_mode" .Fa "struct ucred *cred" .Fa "int *privused" .Fc Index: sys/nfsclient/nfs_vnops.c =================================================================== --- sys/nfsclient/nfs_vnops.c (revision 183742) +++ sys/nfsclient/nfs_vnops.c (working copy) @@ -3200,7 +3200,7 @@ struct vattr *vap; struct ucred *cred = ap->a_cred; struct vnode *vp = ap->a_vp; - mode_t mode = ap->a_mode; + vaccess_t mode = ap->a_mode; struct vattr vattr; int error; Index: sys/gnu/fs/xfs/FreeBSD/xfs_super.c =================================================================== --- sys/gnu/fs/xfs/FreeBSD/xfs_super.c (revision 183742) +++ sys/gnu/fs/xfs/FreeBSD/xfs_super.c (working copy) @@ -133,7 +133,7 @@ struct vnode *devvp; struct g_consumer *cp; struct g_provider *pp; - mode_t accessmode; + vaccess_t accessmode; td = curthread; Index: sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c =================================================================== --- sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c (revision 183742) +++ sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c (working copy) @@ -180,7 +180,7 @@ _xfs_access( struct vop_access_args /* { struct vnode *a_vp; - int a_mode; + vaccess_t a_mode; struct ucred *a_cred; struct thread *a_td; } */ *ap) Index: sys/gnu/fs/reiserfs/reiserfs_vfsops.c =================================================================== --- sys/gnu/fs/reiserfs/reiserfs_vfsops.c (revision 183742) +++ sys/gnu/fs/reiserfs/reiserfs_vfsops.c (working copy) @@ -74,7 +74,7 @@ { size_t size; int error, len; - mode_t accessmode; + vaccess_t accessmode; char *path, *fspec; struct vnode *devvp; struct vfsoptlist *opts; Index: sys/gnu/fs/reiserfs/reiserfs_vnops.c =================================================================== --- sys/gnu/fs/reiserfs/reiserfs_vnops.c (revision 183742) +++ sys/gnu/fs/reiserfs/reiserfs_vnops.c (working copy) @@ -57,7 +57,7 @@ int error; struct vnode *vp = ap->a_vp; struct reiserfs_node *ip = VTOI(vp); - mode_t mode = ap->a_mode; + vaccess_t mode = ap->a_mode; /* * Disallow write attempts on read-only file systems; unless the file Index: sys/gnu/fs/ext2fs/ext2_vnops.c =================================================================== --- sys/gnu/fs/ext2fs/ext2_vnops.c (revision 183742) +++ sys/gnu/fs/ext2fs/ext2_vnops.c (working copy) @@ -289,14 +289,14 @@ ext2_access(ap) struct vop_access_args /* { struct vnode *a_vp; - int a_mode; + vaccess_t a_mode; struct ucred *a_cred; struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); - mode_t mode = ap->a_mode; + vaccess_t mode = ap->a_mode; int error; if (vp->v_type == VBLK || vp->v_type == VCHR) Index: sys/gnu/fs/ext2fs/ext2_vfsops.c =================================================================== --- sys/gnu/fs/ext2fs/ext2_vfsops.c (revision 183742) +++ sys/gnu/fs/ext2fs/ext2_vfsops.c (working copy) @@ -137,7 +137,7 @@ struct ext2_sb_info *fs; char *path, *fspec; int error, flags, len; - mode_t accessmode; + vaccess_t accessmode; struct nameidata nd, *ndp = &nd; opts = mp->mnt_optnew; Index: sys/ufs/ufs/ufs_vnops.c =================================================================== --- sys/ufs/ufs/ufs_vnops.c (revision 183742) +++ sys/ufs/ufs/ufs_vnops.c (working copy) @@ -301,14 +301,14 @@ ufs_access(ap) struct vop_access_args /* { struct vnode *a_vp; - int a_mode; + vaccess_t a_mode; struct ucred *a_cred; struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; struct inode *ip = VTOI(vp); - mode_t mode = ap->a_mode; + vaccess_t mode = ap->a_mode; int error; #ifdef QUOTA int relocked; Index: sys/ufs/ffs/ffs_vfsops.c =================================================================== --- sys/ufs/ffs/ffs_vfsops.c (revision 183742) +++ sys/ufs/ffs/ffs_vfsops.c (working copy) @@ -139,7 +139,7 @@ struct fs *fs; int error, flags; u_int mntorflags, mntandnotflags; - mode_t accessmode; + vaccess_t accessmode; struct nameidata ndp; char *fspec; Index: sys/kern/uipc_mqueue.c =================================================================== --- sys/kern/uipc_mqueue.c (revision 183742) +++ sys/kern/uipc_mqueue.c (working copy) @@ -1120,7 +1120,7 @@ struct vop_access_args { struct vop_generic_args a_gen; struct vnode *a_vp; - int a_mode; + vaccess_t a_mode; struct ucred *a_cred; struct thread *a_td; }; @@ -2003,7 +2003,7 @@ if ((flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) { error = EEXIST; } else { - int acc_mode = 0; + vaccess_t acc_mode = 0; if (flags & FREAD) acc_mode |= VREAD; Index: sys/kern/vfs_vnops.c =================================================================== --- sys/kern/vfs_vnops.c (revision 183742) +++ sys/kern/vfs_vnops.c (working copy) @@ -115,7 +115,8 @@ struct thread *td = ndp->ni_cnd.cn_thread; struct vattr vat; struct vattr *vap = &vat; - int mode, fmode, error; + int fmode, error; + vaccess_t mode; int vfslocked, mpsafe; mpsafe = ndp->ni_cnd.cn_flags & MPSAFE; Index: sys/kern/vfs_syscalls.c =================================================================== --- sys/kern/vfs_syscalls.c (revision 183742) +++ sys/kern/vfs_syscalls.c (working copy) @@ -2032,7 +2032,8 @@ struct ucred *cred; struct thread *td; { - int error, flags; + int error; + vaccess_t flags; /* Flags == 0 means only check for existence. */ error = 0; @@ -4335,7 +4336,8 @@ struct flock lf; struct file *fp; register struct filedesc *fdp = p->p_fd; - int fmode, mode, error, type; + int fmode, error, type; + vaccess_t mode; struct file *nfp; int vfslocked; int indx; Index: sys/kern/uipc_shm.c =================================================================== --- sys/kern/uipc_shm.c (revision 183742) +++ sys/kern/uipc_shm.c (working copy) @@ -367,7 +367,7 @@ static int shm_access(struct shmfd *shmfd, struct ucred *ucred, int flags) { - int acc_mode; + vaccess_t acc_mode; acc_mode = 0; if (flags & FREAD) Index: sys/kern/vnode_if.src =================================================================== --- sys/kern/vnode_if.src (revision 183742) +++ sys/kern/vnode_if.src (working copy) @@ -147,7 +147,7 @@ vop_access { IN struct vnode *vp; - IN int mode; + IN vaccess_t mode; IN struct ucred *cred; IN struct thread *td; }; Index: sys/kern/subr_acl_posix1e.c =================================================================== --- sys/kern/subr_acl_posix1e.c (revision 183742) +++ sys/kern/subr_acl_posix1e.c (working copy) @@ -53,12 +53,12 @@ */ int vaccess_acl_posix1e(enum vtype type, uid_t file_uid, gid_t file_gid, - struct acl *acl, mode_t acc_mode, struct ucred *cred, int *privused) + struct acl *acl, vaccess_t acc_mode, struct ucred *cred, int *privused) { struct acl_entry *acl_other, *acl_mask; - mode_t dac_granted; - mode_t priv_granted; - mode_t acl_mask_granted; + vaccess_t dac_granted; + vaccess_t priv_granted; + vaccess_t acl_mask_granted; int group_matched, i; /* Index: sys/kern/vfs_subr.c =================================================================== --- sys/kern/vfs_subr.c (revision 183742) +++ sys/kern/vfs_subr.c (working copy) @@ -3452,10 +3452,10 @@ */ int vaccess(enum vtype type, mode_t file_mode, uid_t file_uid, gid_t file_gid, - mode_t acc_mode, struct ucred *cred, int *privused) + vaccess_t acc_mode, struct ucred *cred, int *privused) { - mode_t dac_granted; - mode_t priv_granted; + vaccess_t dac_granted; + vaccess_t priv_granted; /* * Look for a normal, non-privileged way to access the file/directory @@ -3559,7 +3559,7 @@ */ int extattr_check_cred(struct vnode *vp, int attrnamespace, struct ucred *cred, - struct thread *td, int access) + struct thread *td, vaccess_t access) { /* Index: sys/fs/unionfs/union_vfsops.c =================================================================== --- sys/fs/unionfs/union_vfsops.c (revision 183742) +++ sys/fs/unionfs/union_vfsops.c (working copy) @@ -121,8 +121,8 @@ int below; uid_t uid; gid_t gid; - u_short udir; - u_short ufile; + vaccess_t udir; + vaccess_t ufile; unionfs_copymode copymode; unionfs_whitemode whitemode; struct componentname fakecn; Index: sys/fs/unionfs/union_vnops.c =================================================================== --- sys/fs/unionfs/union_vnops.c (revision 183742) +++ sys/fs/unionfs/union_vnops.c (working copy) @@ -583,7 +583,7 @@ * Check the access mode toward shadow file/dir. */ static int -unionfs_check_corrected_access(u_short mode, +unionfs_check_corrected_access(vaccess_t mode, struct vattr *va, struct ucred *cred) { @@ -645,7 +645,7 @@ struct vnode *lvp; struct thread *td; struct vattr va; - int mode; + vaccess_t mode; int error; UNIONFS_INTERNAL_DEBUG("unionfs_access: enter\n"); Index: sys/fs/tmpfs/tmpfs_vnops.c =================================================================== --- sys/fs/tmpfs/tmpfs_vnops.c (revision 183742) +++ sys/fs/tmpfs/tmpfs_vnops.c (working copy) @@ -282,7 +282,7 @@ tmpfs_access(struct vop_access_args *v) { struct vnode *vp = v->a_vp; - int mode = v->a_mode; + vaccess_t mode = v->a_mode; struct ucred *cred = v->a_cred; int error; Index: sys/fs/hpfs/hpfs_vnops.c =================================================================== --- sys/fs/hpfs/hpfs_vnops.c (revision 183742) +++ sys/fs/hpfs/hpfs_vnops.c (working copy) @@ -683,14 +683,14 @@ hpfs_access(ap) struct vop_access_args /* { struct vnode *a_vp; - int a_mode; + vaccess_t a_mode; struct ucred *a_cred; struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; struct hpfsnode *hp = VTOHP(vp); - mode_t mode = ap->a_mode; + vaccess_t mode = ap->a_mode; dprintf(("hpfs_access(0x%x):\n", hp->h_no)); Index: sys/fs/nullfs/null_vnops.c =================================================================== --- sys/fs/nullfs/null_vnops.c (revision 183742) +++ sys/fs/nullfs/null_vnops.c (working copy) @@ -451,7 +451,7 @@ null_access(struct vop_access_args *ap) { struct vnode *vp = ap->a_vp; - mode_t mode = ap->a_mode; + vaccess_t mode = ap->a_mode; /* * Disallow write attempts on read-only layers; Index: sys/fs/coda/coda_vnops.c =================================================================== --- sys/fs/coda/coda_vnops.c (revision 183742) +++ sys/fs/coda/coda_vnops.c (working copy) @@ -607,7 +607,7 @@ /* true args */ struct vnode *vp = ap->a_vp; struct cnode *cp = VTOC(vp); - int mode = ap->a_mode; + vaccess_t mode = ap->a_mode; struct ucred *cred = ap->a_cred; struct thread *td = ap->a_td; /* locals */ Index: sys/fs/smbfs/smbfs_vnops.c =================================================================== --- sys/fs/smbfs/smbfs_vnops.c (revision 183742) +++ sys/fs/smbfs/smbfs_vnops.c (working copy) @@ -123,13 +123,13 @@ smbfs_access(ap) struct vop_access_args /* { struct vnode *a_vp; - int a_mode; + vaccess_t a_mode; struct ucred *a_cred; struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; - mode_t mode = ap->a_mode; + vaccess_t mode = ap->a_mode; mode_t mpmode; struct smbmount *smp = VTOSMBFS(vp); Index: sys/fs/ntfs/ntfs_vnops.c =================================================================== --- sys/fs/ntfs/ntfs_vnops.c (revision 183742) +++ sys/fs/ntfs/ntfs_vnops.c (working copy) @@ -386,14 +386,14 @@ ntfs_access(ap) struct vop_access_args /* { struct vnode *a_vp; - int a_mode; + vaccess_t a_mode; struct ucred *a_cred; struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; struct ntnode *ip = VTONT(vp); - mode_t mode = ap->a_mode; + vaccess_t mode = ap->a_mode; #ifdef QUOTA int error; #endif Index: sys/fs/cd9660/cd9660_vnops.c =================================================================== --- sys/fs/cd9660/cd9660_vnops.c (revision 183742) +++ sys/fs/cd9660/cd9660_vnops.c (working copy) @@ -125,14 +125,14 @@ cd9660_access(ap) struct vop_access_args /* { struct vnode *a_vp; - int a_mode; + vaccess_t a_mode; struct ucred *a_cred; struct thread *a_td; } */ *ap; { struct vnode *vp = ap->a_vp; struct iso_node *ip = VTOI(vp); - mode_t mode = ap->a_mode; + vaccess_t mode = ap->a_mode; if (vp->v_type == VCHR || vp->v_type == VBLK) return (EOPNOTSUPP); Index: sys/fs/cd9660/cd9660_vfsops.c =================================================================== --- sys/fs/cd9660/cd9660_vfsops.c (revision 183742) +++ sys/fs/cd9660/cd9660_vfsops.c (working copy) @@ -129,7 +129,7 @@ struct vnode *devvp; char *fspec; int error; - mode_t accessmode; + vaccess_t accessmode; struct nameidata ndp; struct iso_mnt *imp = 0; Index: sys/fs/nwfs/nwfs_vnops.c =================================================================== --- sys/fs/nwfs/nwfs_vnops.c (revision 183742) +++ sys/fs/nwfs/nwfs_vnops.c (working copy) @@ -121,7 +121,7 @@ nwfs_access(ap) struct vop_access_args /* { struct vnode *a_vp; - int a_mode; + vaccess_t a_mode; struct ucred *a_cred; struct thread *td; } */ *ap; Index: sys/fs/msdosfs/msdosfs_vfsops.c =================================================================== --- sys/fs/msdosfs/msdosfs_vfsops.c (revision 183742) +++ sys/fs/msdosfs/msdosfs_vfsops.c (working copy) @@ -241,7 +241,7 @@ struct msdosfsmount *pmp = NULL; struct nameidata ndp; int error, flags; - mode_t accessmode; + vaccess_t accessmode; char *from; if (vfs_filteropt(mp->mnt_optnew, msdosfs_opts)) Index: sys/fs/msdosfs/msdosfs_vnops.c =================================================================== --- sys/fs/msdosfs/msdosfs_vnops.c (revision 183742) +++ sys/fs/msdosfs/msdosfs_vnops.c (working copy) @@ -249,7 +249,7 @@ msdosfs_access(ap) struct vop_access_args /* { struct vnode *a_vp; - int a_mode; + vaccess_t a_mode; struct ucred *a_cred; struct thread *a_td; } */ *ap; @@ -257,7 +257,8 @@ struct vnode *vp = ap->a_vp; struct denode *dep = VTODE(ap->a_vp); struct msdosfsmount *pmp = dep->de_pmp; - mode_t file_mode, mode = ap->a_mode; + mode_t file_mode; + vaccess_t mode = ap->a_mode; file_mode = (S_IXUSR|S_IXGRP|S_IXOTH) | (S_IRUSR|S_IRGRP|S_IROTH) | ((dep->de_Attributes & ATTR_READONLY) ? 0 : (S_IWUSR|S_IWGRP|S_IWOTH)); Index: sys/fs/udf/udf_vnops.c =================================================================== --- sys/fs/udf/udf_vnops.c (revision 183742) +++ sys/fs/udf/udf_vnops.c (working copy) @@ -139,7 +139,8 @@ { struct vnode *vp; struct udf_node *node; - mode_t a_mode, mode; + vaccess_t a_mode; + mode_t mode; vp = a->a_vp; node = VTON(vp); Index: sys/nfsserver/nfs_serv.c =================================================================== --- sys/nfsserver/nfs_serv.c (revision 183742) +++ sys/nfsserver/nfs_serv.c (working copy) @@ -138,7 +138,8 @@ SYSCTL_STRUCT(_vfs_nfsrv, NFS_NFSRVSTATS, nfsrvstats, CTLFLAG_RW, &nfsrvstats, nfsrvstats, "S,nfsrvstats"); -static int nfsrv_access(struct vnode *, int, struct ucred *, int, int); +static int nfsrv_access(struct vnode *, vaccess_t, struct ucred *, + int, int); static void nfsrvw_coalesce(struct nfsrv_descript *, struct nfsrv_descript *); @@ -4234,8 +4235,8 @@ * will return EPERM instead of EACCESS. EPERM is always an error. */ static int -nfsrv_access(struct vnode *vp, int flags, struct ucred *cred, int rdonly, - int override) +nfsrv_access(struct vnode *vp, vaccess_t flags, struct ucred *cred, + int rdonly, int override) { struct vattr vattr; int error; Index: sys/compat/linux/linux_getcwd.c =================================================================== --- sys/compat/linux/linux_getcwd.c (revision 183742) +++ sys/compat/linux/linux_getcwd.c (working copy) @@ -307,7 +307,7 @@ struct vnode *uvp = NULL; char *bp = NULL; int error; - int perms = VEXEC; + vaccess_t perms = VEXEC; if (rvp == NULL) { rvp = fdp->fd_rdir; Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c (revision 183742) +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c (working copy) @@ -3194,12 +3194,11 @@ zfs_freebsd_access(ap) struct vop_access_args /* { struct vnode *a_vp; - int a_mode; + vaccess_t a_mode; struct ucred *a_cred; struct thread *a_td; } */ *ap; { - return (zfs_access(ap->a_vp, ap->a_mode, 0, ap->a_cred)); } Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c (revision 183742) +++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c (working copy) @@ -237,12 +237,12 @@ zfsctl_common_access(ap) struct vop_access_args /* { struct vnode *a_vp; - int a_mode; + vaccess_t a_mode; struct ucred *a_cred; struct thread *a_td; } */ *ap; { - int mode = ap->a_mode; + vaccess_t mode = ap->a_mode; if (mode & VWRITE) return (EACCES); Index: sys/cddl/compat/opensolaris/kern/opensolaris_policy.c =================================================================== --- sys/cddl/compat/opensolaris/kern/opensolaris_policy.c (revision 183742) +++ sys/cddl/compat/opensolaris/kern/opensolaris_policy.c (working copy) @@ -91,7 +91,7 @@ int secpolicy_vnode_access(struct ucred *cred, struct vnode *vp, uint64_t owner, - int mode) + vaccess_t mode) { if ((mode & VREAD) && priv_check_cred(cred, PRIV_VFS_READ, 0) != 0) { Index: sys/cddl/compat/opensolaris/sys/policy.h =================================================================== --- sys/cddl/compat/opensolaris/sys/policy.h (revision 183742) +++ sys/cddl/compat/opensolaris/sys/policy.h (working copy) @@ -46,7 +46,7 @@ int secpolicy_vnode_stky_modify(struct ucred *cred); int secpolicy_vnode_remove(struct ucred *cred); int secpolicy_vnode_access(struct ucred *cred, struct vnode *vp, - uint64_t owner, int mode); + uint64_t owner, vaccess_t mode); int secpolicy_vnode_setdac(struct ucred *cred, uid_t owner); int secpolicy_vnode_setattr(struct ucred *cred, struct vnode *vp, struct vattr *vap, const struct vattr *ovap, int flags, Index: sys/security/mac_test/mac_test.c =================================================================== --- sys/security/mac_test/mac_test.c (revision 183742) +++ sys/security/mac_test/mac_test.c (working copy) @@ -2242,7 +2242,7 @@ COUNTER_DECL(vnode_check_access); static int test_vnode_check_access(struct ucred *cred, struct vnode *vp, - struct label *vplabel, int acc_mode) + struct label *vplabel, vaccess_t acc_mode) { LABEL_CHECK(cred->cr_label, MAGIC_CRED); @@ -2416,7 +2416,7 @@ COUNTER_DECL(vnode_check_open); static int test_vnode_check_open(struct ucred *cred, struct vnode *vp, - struct label *vplabel, int acc_mode) + struct label *vplabel, vaccess_t acc_mode) { LABEL_CHECK(cred->cr_label, MAGIC_CRED); Index: sys/security/mac/mac_vfs.c =================================================================== --- sys/security/mac/mac_vfs.c (revision 183742) +++ sys/security/mac/mac_vfs.c (working copy) @@ -362,7 +362,7 @@ } int -mac_vnode_check_access(struct ucred *cred, struct vnode *vp, int acc_mode) +mac_vnode_check_access(struct ucred *cred, struct vnode *vp, vaccess_t acc_mode) { int error; @@ -546,7 +546,7 @@ } int -mac_vnode_check_open(struct ucred *cred, struct vnode *vp, int acc_mode) +mac_vnode_check_open(struct ucred *cred, struct vnode *vp, vaccess_t acc_mode) { int error; Index: sys/security/mac/mac_framework.h =================================================================== --- sys/security/mac/mac_framework.h (revision 183742) +++ sys/security/mac/mac_framework.h (working copy) @@ -87,6 +87,7 @@ struct vop_setlabel_args; #include /* XXX acl_type_t */ +#include /* vaccess_t */ /* * Entry points to the TrustedBSD MAC Framework from the remainder of the @@ -355,7 +356,7 @@ int mac_vnode_associate_extattr(struct mount *mp, struct vnode *vp); void mac_vnode_associate_singlelabel(struct mount *mp, struct vnode *vp); int mac_vnode_check_access(struct ucred *cred, struct vnode *vp, - int acc_mode); + vaccess_t acc_mode); int mac_vnode_check_chdir(struct ucred *cred, struct vnode *dvp); int mac_vnode_check_chroot(struct ucred *cred, struct vnode *dvp); int mac_vnode_check_create(struct ucred *cred, struct vnode *dvp, @@ -381,7 +382,7 @@ int mac_vnode_check_mprotect(struct ucred *cred, struct vnode *vp, int prot); int mac_vnode_check_open(struct ucred *cred, struct vnode *vp, - int acc_mode); + vaccess_t acc_mode); int mac_vnode_check_poll(struct ucred *active_cred, struct ucred *file_cred, struct vnode *vp); int mac_vnode_check_read(struct ucred *active_cred, Index: sys/security/mac/mac_policy.h =================================================================== --- sys/security/mac/mac_policy.h (revision 183742) +++ sys/security/mac/mac_policy.h (working copy) @@ -61,6 +61,7 @@ * alphabetically. */ #include /* XXX acl_type_t */ +#include /* XXX vaccess_t */ struct acl; struct auditinfo; @@ -516,7 +517,8 @@ struct label *mplabel, struct vnode *vp, struct label *vplabel); typedef int (*mpo_vnode_check_access_t)(struct ucred *cred, - struct vnode *vp, struct label *vplabel, int acc_mode); + struct vnode *vp, struct label *vplabel, + vaccess_t acc_mode); typedef int (*mpo_vnode_check_chdir_t)(struct ucred *cred, struct vnode *dvp, struct label *dvplabel); typedef int (*mpo_vnode_check_chroot_t)(struct ucred *cred, @@ -557,7 +559,8 @@ typedef int (*mpo_vnode_check_mprotect_t)(struct ucred *cred, struct vnode *vp, struct label *vplabel, int prot); typedef int (*mpo_vnode_check_open_t)(struct ucred *cred, - struct vnode *vp, struct label *vplabel, int acc_mode); + struct vnode *vp, struct label *vplabel, + vaccess_t acc_mode); typedef int (*mpo_vnode_check_poll_t)(struct ucred *active_cred, struct ucred *file_cred, struct vnode *vp, struct label *vplabel); Index: sys/security/mac_bsdextended/mac_bsdextended.c =================================================================== --- sys/security/mac_bsdextended/mac_bsdextended.c (revision 183742) +++ sys/security/mac_bsdextended/mac_bsdextended.c (working copy) @@ -219,7 +219,8 @@ static int ugidfw_rulecheck(struct mac_bsdextended_rule *rule, - struct ucred *cred, struct vnode *vp, struct vattr *vap, int acc_mode) + struct ucred *cred, struct vnode *vp, struct vattr *vap, + vaccess_t acc_mode) { int mac_granted, match, priv_granted; int i; @@ -417,7 +418,7 @@ static int ugidfw_check(struct ucred *cred, struct vnode *vp, struct vattr *vap, - int acc_mode) + vaccess_t acc_mode) { int error, i; @@ -495,7 +496,7 @@ static int ugidfw_vnode_check_access(struct ucred *cred, struct vnode *vp, - struct label *vplabel, int acc_mode) + struct label *vplabel, vaccess_t acc_mode) { return (ugidfw_check_vp(cred, vp, acc_mode)); @@ -601,7 +602,7 @@ static int ugidfw_vnode_check_open(struct ucred *cred, struct vnode *vp, - struct label *vplabel, int acc_mode) + struct label *vplabel, vaccess_t acc_mode) { return (ugidfw_check_vp(cred, vp, acc_mode)); Index: sys/security/mac_lomac/mac_lomac.c =================================================================== --- sys/security/mac_lomac/mac_lomac.c (revision 183742) +++ sys/security/mac_lomac/mac_lomac.c (working copy) @@ -2366,7 +2366,7 @@ static int lomac_vnode_check_open(struct ucred *cred, struct vnode *vp, - struct label *vplabel, int acc_mode) + struct label *vplabel, vaccess_t acc_mode) { struct mac_lomac *subj, *obj; Index: sys/security/mac_mls/mac_mls.c =================================================================== --- sys/security/mac_mls/mac_mls.c (revision 183742) +++ sys/security/mac_mls/mac_mls.c (working copy) @@ -2442,7 +2442,7 @@ static int mls_vnode_check_open(struct ucred *cred, struct vnode *vp, - struct label *vplabel, int acc_mode) + struct label *vplabel, vaccess_t acc_mode) { struct mac_mls *subj, *obj; Index: sys/security/mac_biba/mac_biba.c =================================================================== --- sys/security/mac_biba/mac_biba.c (revision 183742) +++ sys/security/mac_biba/mac_biba.c (working copy) @@ -2819,7 +2819,7 @@ static int biba_vnode_check_open(struct ucred *cred, struct vnode *vp, - struct label *vplabel, int acc_mode) + struct label *vplabel, vaccess_t acc_mode) { struct mac_biba *subj, *obj; Index: sys/security/mac_stub/mac_stub.c =================================================================== --- sys/security/mac_stub/mac_stub.c (revision 183742) +++ sys/security/mac_stub/mac_stub.c (working copy) @@ -985,7 +985,7 @@ static int stub_vnode_check_access(struct ucred *cred, struct vnode *vp, - struct label *vplabel, int acc_mode) + struct label *vplabel, vaccess_t acc_mode) { return (0); @@ -1300,7 +1300,7 @@ static int stub_vnode_check_open(struct ucred *cred, struct vnode *vp, - struct label *vplabel, int acc_mode) + struct label *vplabel, vaccess_t acc_mode) { return (0); Index: sys/sys/extattr.h =================================================================== --- sys/sys/extattr.h (revision 183742) +++ sys/sys/extattr.h (working copy) @@ -58,13 +58,14 @@ EXTATTR_NAMESPACE_SYSTEM_STRING } #ifdef _KERNEL +#include #define EXTATTR_MAXNAMELEN NAME_MAX struct thread; struct ucred; struct vnode; int extattr_check_cred(struct vnode *vp, int attrnamespace, - struct ucred *cred, struct thread *td, int access); + struct ucred *cred, struct thread *td, vaccess_t access); #else #include Index: sys/sys/_types.h =================================================================== --- sys/sys/_types.h (revision 183742) +++ sys/sys/_types.h (working copy) @@ -47,6 +47,7 @@ typedef long __key_t; /* IPC key (for Sys V IPC) */ typedef __int32_t __lwpid_t; /* Thread ID (a.k.a. LWP) */ typedef __uint16_t __mode_t; /* permissions */ +typedef int __vaccess_t; /* access permissions */ typedef int __nl_item; typedef __uint16_t __nlink_t; /* link count */ typedef __int64_t __off_t; /* file offset */ Index: sys/sys/types.h =================================================================== --- sys/sys/types.h (revision 183742) +++ sys/sys/types.h (working copy) @@ -205,6 +205,11 @@ #define _MODE_T_DECLARED #endif +#ifndef _VACCESS_T_DECLARED +typedef __vaccess_t vaccess_t; /* access permissions */ +#define _VACCESS_T_DECLARED +#endif + #ifndef _NLINK_T_DECLARED typedef __nlink_t nlink_t; /* link count */ #define _NLINK_T_DECLARED Index: sys/sys/vnode.h =================================================================== --- sys/sys/vnode.h (revision 183742) +++ sys/sys/vnode.h (working copy) @@ -309,7 +309,7 @@ #define IO_SEQSHIFT 16 /* seq heuristic in upper 16 bits */ /* - * Modes. Some values same as Ixxx entries from inode.h for now. + * Flags for vaccess_t. */ #define VEXEC 000100 /* execute/search permission */ #define VWRITE 000200 /* write permission */ @@ -584,10 +584,10 @@ char **retbuf, char **freebuf); int vn_commname(struct vnode *vn, char *buf, u_int buflen); int vaccess(enum vtype type, mode_t file_mode, uid_t file_uid, - gid_t file_gid, mode_t acc_mode, struct ucred *cred, + gid_t file_gid, vaccess_t acc_mode, struct ucred *cred, int *privused); int vaccess_acl_posix1e(enum vtype type, uid_t file_uid, - gid_t file_gid, struct acl *acl, mode_t acc_mode, + gid_t file_gid, struct acl *acl, vaccess_t acc_mode, struct ucred *cred, int *privused); void vattr_null(struct vattr *vap); int vcount(struct vnode *vp);