svn commit: r184413 - in head: share/man/man9
sys/cddl/compat/opensolaris/kern sys/cddl/compat/opensolaris/sys
sys/cddl/contrib/opensolaris/uts/common/fs/zfs
sys/compat/linux sys/fs/cd9660 sys/fs/c...
Edward Tomasz Napierala
trasz at FreeBSD.org
Tue Oct 28 06:44:13 PDT 2008
Author: trasz
Date: Tue Oct 28 13:44:11 2008
New Revision: 184413
URL: http://svn.freebsd.org/changeset/base/184413
Log:
Introduce accmode_t. This is required for NFSv4 ACLs - it will be neccessary
to add more V* constants, and the variables changed by this patch were often
being assigned to mode_t variables, which is 16 bit.
Approved by: rwatson (mentor)
Modified:
head/share/man/man9/VOP_ACCESS.9
head/share/man/man9/vaccess.9
head/share/man/man9/vaccess_acl_posix1e.9
head/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c
head/sys/cddl/compat/opensolaris/sys/policy.h
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
head/sys/compat/linux/linux_getcwd.c
head/sys/fs/cd9660/cd9660_vfsops.c
head/sys/fs/cd9660/cd9660_vnops.c
head/sys/fs/coda/coda_vnops.c
head/sys/fs/devfs/devfs_vnops.c
head/sys/fs/hpfs/hpfs_vnops.c
head/sys/fs/msdosfs/msdosfs_vfsops.c
head/sys/fs/msdosfs/msdosfs_vnops.c
head/sys/fs/ntfs/ntfs_vnops.c
head/sys/fs/nullfs/null_vnops.c
head/sys/fs/nwfs/nwfs_vnops.c
head/sys/fs/pseudofs/pseudofs_vnops.c
head/sys/fs/smbfs/smbfs_vnops.c
head/sys/fs/tmpfs/tmpfs_vnops.c
head/sys/fs/udf/udf_vnops.c
head/sys/fs/unionfs/union_vnops.c
head/sys/gnu/fs/ext2fs/ext2_vfsops.c
head/sys/gnu/fs/ext2fs/ext2_vnops.c
head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c
head/sys/gnu/fs/reiserfs/reiserfs_vnops.c
head/sys/gnu/fs/xfs/FreeBSD/xfs_super.c
head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c
head/sys/kern/subr_acl_posix1e.c
head/sys/kern/uipc_mqueue.c
head/sys/kern/uipc_shm.c
head/sys/kern/vfs_subr.c
head/sys/kern/vfs_syscalls.c
head/sys/kern/vfs_vnops.c
head/sys/kern/vnode_if.src
head/sys/nfs4client/nfs4_vnops.c
head/sys/nfsclient/nfs_vnops.c
head/sys/nfsserver/nfs_serv.c
head/sys/security/mac/mac_framework.h
head/sys/security/mac/mac_policy.h
head/sys/security/mac/mac_vfs.c
head/sys/security/mac_biba/mac_biba.c
head/sys/security/mac_bsdextended/ugidfw_internal.h
head/sys/security/mac_bsdextended/ugidfw_vnode.c
head/sys/security/mac_lomac/mac_lomac.c
head/sys/security/mac_mls/mac_mls.c
head/sys/security/mac_stub/mac_stub.c
head/sys/security/mac_test/mac_test.c
head/sys/sys/_types.h
head/sys/sys/extattr.h
head/sys/sys/types.h
head/sys/sys/vnode.h
head/sys/ufs/ffs/ffs_vfsops.c
head/sys/ufs/ufs/ufs_vnops.c
Modified: head/share/man/man9/VOP_ACCESS.9
==============================================================================
--- head/share/man/man9/VOP_ACCESS.9 Tue Oct 28 12:49:07 2008 (r184412)
+++ head/share/man/man9/VOP_ACCESS.9 Tue Oct 28 13:44:11 2008 (r184413)
@@ -39,16 +39,16 @@
.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" "accmode_t accmode" "struct ucred *cred" "struct thread *td"
.Sh DESCRIPTION
This entry point checks the access permissions of the file against the
given credentials.
.Pp
Its arguments are:
-.Bl -tag -width mode
+.Bl -tag -width accmode
.It Fa vp
The vnode of the file to check.
-.It Fa mode
+.It Fa accmode
The type of access required.
.It Fa cred
The user credentials to check.
@@ -57,8 +57,8 @@ The thread which is checking.
.El
.Pp
The
-.Fa mode
-is a mask which can contain
+.Fa accmode
+is a mask which can contain flags described in <sys/vnode.h>, e.g.
.Dv VREAD ,
.Dv VWRITE
or
@@ -71,7 +71,7 @@ otherwise an appropriate error code is r
.Sh PSEUDOCODE
.Bd -literal
int
-vop_access(struct vnode *vp, int mode, struct ucred *cred, struct thread *td)
+vop_access(struct vnode *vp, accmode_t accmode, struct ucred *cred, struct thread *td)
{
int error;
@@ -80,7 +80,7 @@ vop_access(struct vnode *vp, int mode, s
* unless the file is a socket, fifo, or a block or
* character device resident on the filesystem.
*/
- if (mode & VWRITE) {
+ if (accmode & VWRITE) {
switch (vp->v_type) {
case VDIR:
case VLNK:
@@ -93,7 +93,7 @@ vop_access(struct vnode *vp, int mode, s
}
/* If immutable bit set, nobody gets to write it. */
- if ((mode & VWRITE) && vp has immutable bit set)
+ if ((accmode & VWRITE) && vp has immutable bit set)
return EPERM;
/* Otherwise, user id 0 always gets access. */
@@ -104,11 +104,11 @@ vop_access(struct vnode *vp, int mode, s
/* Otherwise, check the owner. */
if (cred->cr_uid == owner of vp) {
- if (mode & VEXEC)
+ if (accmode & VEXEC)
mask |= S_IXUSR;
- if (mode & VREAD)
+ if (accmode & VREAD)
mask |= S_IRUSR;
- if (mode & VWRITE)
+ if (accmode & VWRITE)
mask |= S_IWUSR;
return (((mode of vp) & mask) == mask ? 0 : EACCES);
}
@@ -116,21 +116,21 @@ vop_access(struct vnode *vp, int mode, s
/* Otherwise, check the groups. */
for (i = 0, gp = cred->cr_groups; i < cred->cr_ngroups; i++, gp++)
if (group of vp == *gp) {
- if (mode & VEXEC)
+ if (accmode & VEXEC)
mask |= S_IXGRP;
- if (mode & VREAD)
+ if (accmode & VREAD)
mask |= S_IRGRP;
- if (mode & VWRITE)
+ if (accmode & VWRITE)
mask |= S_IWGRP;
return (((mode of vp) & mask) == mask ? 0 : EACCES);
}
/* Otherwise, check everyone else. */
- if (mode & VEXEC)
+ if (accmode & VEXEC)
mask |= S_IXOTH;
- if (mode & VREAD)
+ if (accmode & VREAD)
mask |= S_IROTH;
- if (mode & VWRITE)
+ if (accmode & VWRITE)
mask |= S_IWOTH;
return (((mode of vp) & mask) == mask ? 0 : EACCES);
}
Modified: head/share/man/man9/vaccess.9
==============================================================================
--- head/share/man/man9/vaccess.9 Tue Oct 28 12:49:07 2008 (r184412)
+++ head/share/man/man9/vaccess.9 Tue Oct 28 13:44:11 2008 (r184413)
@@ -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 "accmode_t accmode"
.Fa "struct ucred *cred"
.Fa "int *privused"
.Fc
@@ -59,7 +59,7 @@ owning UID
owning GID
.Fa file_gid ,
desired access mode
-.Fa acc_mode ,
+.Fa accmode ,
requesting credential
.Fa cred ,
and an optional call-by-reference
Modified: head/share/man/man9/vaccess_acl_posix1e.9
==============================================================================
--- head/share/man/man9/vaccess_acl_posix1e.9 Tue Oct 28 12:49:07 2008 (r184412)
+++ head/share/man/man9/vaccess_acl_posix1e.9 Tue Oct 28 13:44:11 2008 (r184413)
@@ -41,7 +41,7 @@
.Fa "uid_t file_uid"
.Fa "gid_t file_gid"
.Fa "struct acl *acl"
-.Fa "mode_t acc_mode"
+.Fa "accmode_t accmode"
.Fa "struct ucred *cred"
.Fa "int *privused"
.Fc
@@ -59,7 +59,7 @@ owning GID
access ACL for the file
.Fa acl ,
desired access mode
-.Fa acc_mode ,
+.Fa accmode ,
requesting credential
.Fa cred ,
and an optional call-by-reference
Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c
==============================================================================
--- head/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -91,17 +91,17 @@ secpolicy_vnode_remove(struct ucred *cre
int
secpolicy_vnode_access(struct ucred *cred, struct vnode *vp, uint64_t owner,
- int mode)
+ accmode_t accmode)
{
- if ((mode & VREAD) && priv_check_cred(cred, PRIV_VFS_READ, 0) != 0) {
+ if ((accmode & VREAD) && priv_check_cred(cred, PRIV_VFS_READ, 0) != 0) {
return (EACCES);
}
- if ((mode & VWRITE) &&
+ if ((accmode & VWRITE) &&
priv_check_cred(cred, PRIV_VFS_WRITE, 0) != 0) {
return (EACCES);
}
- if (mode & VEXEC) {
+ if (accmode & VEXEC) {
if (vp->v_type == VDIR) {
if (priv_check_cred(cred, PRIV_VFS_LOOKUP, 0) != 0) {
return (EACCES);
Modified: head/sys/cddl/compat/opensolaris/sys/policy.h
==============================================================================
--- head/sys/cddl/compat/opensolaris/sys/policy.h Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/cddl/compat/opensolaris/sys/policy.h Tue Oct 28 13:44:11 2008 (r184413)
@@ -46,7 +46,7 @@ int secpolicy_basic_link(struct ucred *
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, accmode_t accmode);
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,
Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -237,14 +237,14 @@ static int
zfsctl_common_access(ap)
struct vop_access_args /* {
struct vnode *a_vp;
- int a_mode;
+ accmode_t a_accmode;
struct ucred *a_cred;
struct thread *a_td;
} */ *ap;
{
- int mode = ap->a_mode;
+ accmode_t accmode = ap->a_accmode;
- if (mode & VWRITE)
+ if (accmode & VWRITE)
return (EACCES);
return (0);
Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -3194,13 +3194,13 @@ static int
zfs_freebsd_access(ap)
struct vop_access_args /* {
struct vnode *a_vp;
- int a_mode;
+ accmode_t a_accmode;
struct ucred *a_cred;
struct thread *a_td;
} */ *ap;
{
- return (zfs_access(ap->a_vp, ap->a_mode, 0, ap->a_cred));
+ return (zfs_access(ap->a_vp, ap->a_accmode, 0, ap->a_cred));
}
static int
Modified: head/sys/compat/linux/linux_getcwd.c
==============================================================================
--- head/sys/compat/linux/linux_getcwd.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/compat/linux/linux_getcwd.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -307,7 +307,7 @@ linux_getcwd_common (lvp, rvp, bpp, bufp
struct vnode *uvp = NULL;
char *bp = NULL;
int error;
- int perms = VEXEC;
+ accmode_t accmode = VEXEC;
if (rvp == NULL) {
rvp = fdp->fd_rdir;
@@ -352,10 +352,10 @@ linux_getcwd_common (lvp, rvp, bpp, bufp
* whether or not caller cares.
*/
if (flags & GETCWD_CHECK_ACCESS) {
- error = VOP_ACCESS(lvp, perms, td->td_ucred, td);
+ error = VOP_ACCESS(lvp, accmode, td->td_ucred, td);
if (error)
goto out;
- perms = VEXEC|VREAD;
+ accmode = VEXEC|VREAD;
}
/*
Modified: head/sys/fs/cd9660/cd9660_vfsops.c
==============================================================================
--- head/sys/fs/cd9660/cd9660_vfsops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/fs/cd9660/cd9660_vfsops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -128,7 +128,7 @@ cd9660_mount(struct mount *mp, struct th
struct vnode *devvp;
char *fspec;
int error;
- mode_t accessmode;
+ accmode_t accmode;
struct nameidata ndp;
struct iso_mnt *imp = 0;
@@ -168,9 +168,9 @@ cd9660_mount(struct mount *mp, struct th
* Verify that user has necessary permissions on the device,
* or has superuser abilities
*/
- accessmode = VREAD;
+ accmode = VREAD;
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
- error = VOP_ACCESS(devvp, accessmode, td->td_ucred, td);
+ error = VOP_ACCESS(devvp, accmode, td->td_ucred, td);
if (error)
error = priv_check(td, PRIV_VFS_MOUNT_PERM);
if (error) {
Modified: head/sys/fs/cd9660/cd9660_vnops.c
==============================================================================
--- head/sys/fs/cd9660/cd9660_vnops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/fs/cd9660/cd9660_vnops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -125,14 +125,14 @@ static int
cd9660_access(ap)
struct vop_access_args /* {
struct vnode *a_vp;
- int a_mode;
+ accmode_t a_accmode;
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;
+ accmode_t accmode = ap->a_accmode;
if (vp->v_type == VCHR || vp->v_type == VBLK)
return (EOPNOTSUPP);
@@ -142,7 +142,7 @@ cd9660_access(ap)
* fifo, or a block or character device resident on the
* filesystem.
*/
- if (mode & VWRITE) {
+ if (accmode & VWRITE) {
switch (vp->v_type) {
case VDIR:
case VLNK:
@@ -155,7 +155,7 @@ cd9660_access(ap)
}
return (vaccess(vp->v_type, ip->inode.iso_mode, ip->inode.iso_uid,
- ip->inode.iso_gid, ap->a_mode, ap->a_cred, NULL));
+ ip->inode.iso_gid, ap->a_accmode, ap->a_cred, NULL));
}
static int
Modified: head/sys/fs/coda/coda_vnops.c
==============================================================================
--- head/sys/fs/coda/coda_vnops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/fs/coda/coda_vnops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -607,7 +607,7 @@ coda_access(struct vop_access_args *ap)
/* true args */
struct vnode *vp = ap->a_vp;
struct cnode *cp = VTOC(vp);
- int mode = ap->a_mode;
+ accmode_t accmode = ap->a_accmode;
struct ucred *cred = ap->a_cred;
struct thread *td = ap->a_td;
/* locals */
@@ -624,7 +624,7 @@ coda_access(struct vop_access_args *ap)
* Bogus hack - all will be marked as successes.
*/
MARK_INT_SAT(CODA_ACCESS_STATS);
- return (((mode & VREAD) && !(mode & (VWRITE | VEXEC)))
+ return (((accmode & VREAD) && !(accmode & (VWRITE | VEXEC)))
? 0 : EACCES);
}
@@ -636,11 +636,11 @@ coda_access(struct vop_access_args *ap)
*/
if (coda_access_cache && VALID_ACCCACHE(cp) &&
(cred->cr_uid == cp->c_cached_uid) &&
- (mode & cp->c_cached_mode) == mode) {
+ (accmode & cp->c_cached_mode) == accmode) {
MARK_INT_SAT(CODA_ACCESS_STATS);
return (0);
}
- error = venus_access(vtomi(vp), &cp->c_fid, mode, cred, td->td_proc);
+ error = venus_access(vtomi(vp), &cp->c_fid, accmode, cred, td->td_proc);
if (error == 0 && coda_access_cache) {
/*-
* When we have a new successful request, we consider three
@@ -658,10 +658,10 @@ coda_access(struct vop_access_args *ap)
*/
cp->c_flags |= C_ACCCACHE;
if (cp->c_cached_uid != cred->cr_uid) {
- cp->c_cached_mode = mode;
+ cp->c_cached_mode = accmode;
cp->c_cached_uid = cred->cr_uid;
} else
- cp->c_cached_mode |= mode;
+ cp->c_cached_mode |= accmode;
}
return (error);
}
Modified: head/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- head/sys/fs/devfs/devfs_vnops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/fs/devfs/devfs_vnops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -372,7 +372,7 @@ devfs_access(struct vop_access_args *ap)
de = de->de_dir;
error = vaccess(vp->v_type, de->de_mode, de->de_uid, de->de_gid,
- ap->a_mode, ap->a_cred, NULL);
+ ap->a_accmode, ap->a_cred, NULL);
if (!error)
return (error);
if (error != EACCES)
Modified: head/sys/fs/hpfs/hpfs_vnops.c
==============================================================================
--- head/sys/fs/hpfs/hpfs_vnops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/fs/hpfs/hpfs_vnops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -683,14 +683,14 @@ int
hpfs_access(ap)
struct vop_access_args /* {
struct vnode *a_vp;
- int a_mode;
+ accmode_t a_accmode;
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;
+ accmode_t accmode = ap->a_accmode;
dprintf(("hpfs_access(0x%x):\n", hp->h_no));
@@ -699,7 +699,7 @@ hpfs_access(ap)
* unless the file is a socket, fifo, or a block or
* character device resident on the filesystem.
*/
- if (mode & VWRITE) {
+ if (accmode & VWRITE) {
switch ((int)vp->v_type) {
case VDIR:
case VLNK:
@@ -711,7 +711,7 @@ hpfs_access(ap)
}
return (vaccess(vp->v_type, hp->h_mode, hp->h_uid, hp->h_gid,
- ap->a_mode, ap->a_cred, NULL));
+ ap->a_accmode, ap->a_cred, NULL));
}
/*
Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c
==============================================================================
--- head/sys/fs/msdosfs/msdosfs_vfsops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/fs/msdosfs/msdosfs_vfsops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -240,7 +240,7 @@ msdosfs_mount(struct mount *mp, struct t
struct msdosfsmount *pmp = NULL;
struct nameidata ndp;
int error, flags;
- mode_t accessmode;
+ accmode_t accmode;
char *from;
if (vfs_filteropt(mp->mnt_optnew, msdosfs_opts))
@@ -363,10 +363,10 @@ msdosfs_mount(struct mount *mp, struct t
* If mount by non-root, then verify that user has necessary
* permissions on the device.
*/
- accessmode = VREAD;
+ accmode = VREAD;
if ((mp->mnt_flag & MNT_RDONLY) == 0)
- accessmode |= VWRITE;
- error = VOP_ACCESS(devvp, accessmode, td->td_ucred, td);
+ accmode |= VWRITE;
+ error = VOP_ACCESS(devvp, accmode, td->td_ucred, td);
if (error)
error = priv_check(td, PRIV_VFS_MOUNT_PERM);
if (error) {
Modified: head/sys/fs/msdosfs/msdosfs_vnops.c
==============================================================================
--- head/sys/fs/msdosfs/msdosfs_vnops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/fs/msdosfs/msdosfs_vnops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -249,7 +249,7 @@ static int
msdosfs_access(ap)
struct vop_access_args /* {
struct vnode *a_vp;
- int a_mode;
+ accmode_t a_accmode;
struct ucred *a_cred;
struct thread *a_td;
} */ *ap;
@@ -257,7 +257,8 @@ msdosfs_access(ap)
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;
+ accmode_t accmode = ap->a_accmode;
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));
@@ -267,7 +268,7 @@ msdosfs_access(ap)
* Disallow writing to directories and regular files if the
* filesystem is read-only.
*/
- if (mode & VWRITE) {
+ if (accmode & VWRITE) {
switch (vp->v_type) {
case VDIR:
case VREG:
@@ -280,7 +281,7 @@ msdosfs_access(ap)
}
return (vaccess(vp->v_type, file_mode, pmp->pm_uid, pmp->pm_gid,
- ap->a_mode, ap->a_cred, NULL));
+ ap->a_accmode, ap->a_cred, NULL));
}
static int
Modified: head/sys/fs/ntfs/ntfs_vnops.c
==============================================================================
--- head/sys/fs/ntfs/ntfs_vnops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/fs/ntfs/ntfs_vnops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -386,14 +386,14 @@ int
ntfs_access(ap)
struct vop_access_args /* {
struct vnode *a_vp;
- int a_mode;
+ accmode_t a_accmode;
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;
+ accmode_t accmode = ap->a_accmode;
#ifdef QUOTA
int error;
#endif
@@ -405,7 +405,7 @@ ntfs_access(ap)
* unless the file is a socket, fifo, or a block or
* character device resident on the filesystem.
*/
- if (mode & VWRITE) {
+ if (accmode & VWRITE) {
switch ((int)vp->v_type) {
case VDIR:
case VLNK:
@@ -421,7 +421,7 @@ ntfs_access(ap)
}
return (vaccess(vp->v_type, ip->i_mp->ntm_mode, ip->i_mp->ntm_uid,
- ip->i_mp->ntm_gid, ap->a_mode, ap->a_cred, NULL));
+ ip->i_mp->ntm_gid, ap->a_accmode, ap->a_cred, NULL));
}
/*
Modified: head/sys/fs/nullfs/null_vnops.c
==============================================================================
--- head/sys/fs/nullfs/null_vnops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/fs/nullfs/null_vnops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -451,14 +451,14 @@ static int
null_access(struct vop_access_args *ap)
{
struct vnode *vp = ap->a_vp;
- mode_t mode = ap->a_mode;
+ accmode_t accmode = ap->a_accmode;
/*
* Disallow write attempts on read-only layers;
* unless the file is a socket, fifo, or a block or
* character device resident on the filesystem.
*/
- if (mode & VWRITE) {
+ if (accmode & VWRITE) {
switch (vp->v_type) {
case VDIR:
case VLNK:
Modified: head/sys/fs/nwfs/nwfs_vnops.c
==============================================================================
--- head/sys/fs/nwfs/nwfs_vnops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/fs/nwfs/nwfs_vnops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -121,7 +121,7 @@ static int
nwfs_access(ap)
struct vop_access_args /* {
struct vnode *a_vp;
- int a_mode;
+ accmode_t a_accmode;
struct ucred *a_cred;
struct thread *td;
} */ *ap;
@@ -131,7 +131,7 @@ nwfs_access(ap)
struct nwmount *nmp = VTONWFS(vp);
NCPVNDEBUG("\n");
- if ((ap->a_mode & VWRITE) && (vp->v_mount->mnt_flag & MNT_RDONLY)) {
+ if ((ap->a_accmode & VWRITE) && (vp->v_mount->mnt_flag & MNT_RDONLY)) {
switch (vp->v_type) {
case VREG: case VDIR: case VLNK:
return (EROFS);
@@ -142,7 +142,7 @@ nwfs_access(ap)
mpmode = vp->v_type == VREG ? nmp->m.file_mode :
nmp->m.dir_mode;
return (vaccess(vp->v_type, mpmode, nmp->m.uid,
- nmp->m.gid, ap->a_mode, ap->a_cred, NULL));
+ nmp->m.gid, ap->a_accmode, ap->a_cred, NULL));
}
/*
* nwfs_open vnode op
Modified: head/sys/fs/pseudofs/pseudofs_vnops.c
==============================================================================
--- head/sys/fs/pseudofs/pseudofs_vnops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/fs/pseudofs/pseudofs_vnops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -132,7 +132,7 @@ pfs_access(struct vop_access_args *va)
if (error)
PFS_RETURN (error);
error = vaccess(vn->v_type, vattr.va_mode, vattr.va_uid,
- vattr.va_gid, va->a_mode, va->a_cred, NULL);
+ vattr.va_gid, va->a_accmode, va->a_cred, NULL);
PFS_RETURN (error);
}
Modified: head/sys/fs/smbfs/smbfs_vnops.c
==============================================================================
--- head/sys/fs/smbfs/smbfs_vnops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/fs/smbfs/smbfs_vnops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -123,18 +123,18 @@ static int
smbfs_access(ap)
struct vop_access_args /* {
struct vnode *a_vp;
- int a_mode;
+ accmode_t a_accmode;
struct ucred *a_cred;
struct thread *a_td;
} */ *ap;
{
struct vnode *vp = ap->a_vp;
- mode_t mode = ap->a_mode;
+ accmode_t accmode = ap->a_accmode;
mode_t mpmode;
struct smbmount *smp = VTOSMBFS(vp);
SMBVDEBUG("\n");
- if ((mode & VWRITE) && (vp->v_mount->mnt_flag & MNT_RDONLY)) {
+ if ((accmode & VWRITE) && (vp->v_mount->mnt_flag & MNT_RDONLY)) {
switch (vp->v_type) {
case VREG: case VDIR: case VLNK:
return EROFS;
@@ -144,7 +144,7 @@ smbfs_access(ap)
}
mpmode = vp->v_type == VREG ? smp->sm_file_mode : smp->sm_dir_mode;
return (vaccess(vp->v_type, mpmode, smp->sm_uid,
- smp->sm_gid, ap->a_mode, ap->a_cred, NULL));
+ smp->sm_gid, ap->a_accmode, ap->a_cred, NULL));
}
/* ARGSUSED */
Modified: head/sys/fs/tmpfs/tmpfs_vnops.c
==============================================================================
--- head/sys/fs/tmpfs/tmpfs_vnops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/fs/tmpfs/tmpfs_vnops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -282,7 +282,7 @@ int
tmpfs_access(struct vop_access_args *v)
{
struct vnode *vp = v->a_vp;
- int mode = v->a_mode;
+ accmode_t accmode = v->a_accmode;
struct ucred *cred = v->a_cred;
int error;
@@ -298,7 +298,7 @@ tmpfs_access(struct vop_access_args *v)
case VLNK:
/* FALLTHROUGH */
case VREG:
- if (mode & VWRITE && vp->v_mount->mnt_flag & MNT_RDONLY) {
+ if (accmode & VWRITE && vp->v_mount->mnt_flag & MNT_RDONLY) {
error = EROFS;
goto out;
}
@@ -318,13 +318,13 @@ tmpfs_access(struct vop_access_args *v)
goto out;
}
- if (mode & VWRITE && node->tn_flags & IMMUTABLE) {
+ if (accmode & VWRITE && node->tn_flags & IMMUTABLE) {
error = EPERM;
goto out;
}
error = vaccess(vp->v_type, node->tn_mode, node->tn_uid,
- node->tn_gid, mode, cred, NULL);
+ node->tn_gid, accmode, cred, NULL);
out:
MPASS(VOP_ISLOCKED(vp));
Modified: head/sys/fs/udf/udf_vnops.c
==============================================================================
--- head/sys/fs/udf/udf_vnops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/fs/udf/udf_vnops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -139,13 +139,14 @@ udf_access(struct vop_access_args *a)
{
struct vnode *vp;
struct udf_node *node;
- mode_t a_mode, mode;
+ accmode_t accmode;
+ mode_t mode;
vp = a->a_vp;
node = VTON(vp);
- a_mode = a->a_mode;
+ accmode = a->a_accmode;
- if (a_mode & VWRITE) {
+ if (accmode & VWRITE) {
switch (vp->v_type) {
case VDIR:
case VLNK:
@@ -160,7 +161,7 @@ udf_access(struct vop_access_args *a)
mode = udf_permtomode(node);
return (vaccess(vp->v_type, mode, node->fentry->uid, node->fentry->gid,
- a_mode, a->a_cred, NULL));
+ accmode, a->a_cred, NULL));
}
static int
Modified: head/sys/fs/unionfs/union_vnops.c
==============================================================================
--- head/sys/fs/unionfs/union_vnops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/fs/unionfs/union_vnops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -583,7 +583,7 @@ unionfs_close_abort:
* Check the access mode toward shadow file/dir.
*/
static int
-unionfs_check_corrected_access(u_short mode,
+unionfs_check_corrected_access(accmode_t accmode,
struct vattr *va,
struct ucred *cred)
{
@@ -601,11 +601,11 @@ unionfs_check_corrected_access(u_short m
/* check owner */
if (cred->cr_uid == uid) {
- if (mode & VEXEC)
+ if (accmode & VEXEC)
mask |= S_IXUSR;
- if (mode & VREAD)
+ if (accmode & VREAD)
mask |= S_IRUSR;
- if (mode & VWRITE)
+ if (accmode & VWRITE)
mask |= S_IWUSR;
return ((vmode & mask) == mask ? 0 : EACCES);
}
@@ -615,22 +615,22 @@ unionfs_check_corrected_access(u_short m
gp = cred->cr_groups;
for (; count < cred->cr_ngroups; count++, gp++) {
if (gid == *gp) {
- if (mode & VEXEC)
+ if (accmode & VEXEC)
mask |= S_IXGRP;
- if (mode & VREAD)
+ if (accmode & VREAD)
mask |= S_IRGRP;
- if (mode & VWRITE)
+ if (accmode & VWRITE)
mask |= S_IWGRP;
return ((vmode & mask) == mask ? 0 : EACCES);
}
}
/* check other */
- if (mode & VEXEC)
+ if (accmode & VEXEC)
mask |= S_IXOTH;
- if (mode & VREAD)
+ if (accmode & VREAD)
mask |= S_IROTH;
- if (mode & VWRITE)
+ if (accmode & VWRITE)
mask |= S_IWOTH;
return ((vmode & mask) == mask ? 0 : EACCES);
@@ -645,7 +645,7 @@ unionfs_access(struct vop_access_args *a
struct vnode *lvp;
struct thread *td;
struct vattr va;
- int mode;
+ accmode_t accmode;
int error;
UNIONFS_INTERNAL_DEBUG("unionfs_access: enter\n");
@@ -655,10 +655,10 @@ unionfs_access(struct vop_access_args *a
uvp = unp->un_uppervp;
lvp = unp->un_lowervp;
td = ap->a_td;
- mode = ap->a_mode;
+ accmode = ap->a_accmode;
error = EACCES;
- if ((mode & VWRITE) &&
+ if ((accmode & VWRITE) &&
(ap->a_vp->v_mount->mnt_flag & MNT_RDONLY)) {
switch (ap->a_vp->v_type) {
case VREG:
@@ -671,7 +671,7 @@ unionfs_access(struct vop_access_args *a
}
if (uvp != NULLVP) {
- error = VOP_ACCESS(uvp, mode, ap->a_cred, td);
+ error = VOP_ACCESS(uvp, accmode, ap->a_cred, td);
UNIONFS_INTERNAL_DEBUG("unionfs_access: leave (%d)\n", error);
@@ -679,7 +679,7 @@ unionfs_access(struct vop_access_args *a
}
if (lvp != NULLVP) {
- if (mode & VWRITE) {
+ if (accmode & VWRITE) {
if (ump->um_uppervp->v_mount->mnt_flag & MNT_RDONLY) {
switch (ap->a_vp->v_type) {
case VREG:
@@ -698,15 +698,15 @@ unionfs_access(struct vop_access_args *a
return (error);
error = unionfs_check_corrected_access(
- mode, &va, ap->a_cred);
+ accmode, &va, ap->a_cred);
if (error != 0)
return (error);
}
}
- mode &= ~VWRITE;
- mode |= VREAD; /* will copy to upper */
+ accmode &= ~VWRITE;
+ accmode |= VREAD; /* will copy to upper */
}
- error = VOP_ACCESS(lvp, mode, ap->a_cred, td);
+ error = VOP_ACCESS(lvp, accmode, ap->a_cred, td);
}
UNIONFS_INTERNAL_DEBUG("unionfs_access: leave (%d)\n", error);
Modified: head/sys/gnu/fs/ext2fs/ext2_vfsops.c
==============================================================================
--- head/sys/gnu/fs/ext2fs/ext2_vfsops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/gnu/fs/ext2fs/ext2_vfsops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -137,7 +137,7 @@ ext2_mount(mp, td)
struct ext2_sb_info *fs;
char *path, *fspec;
int error, flags, len;
- mode_t accessmode;
+ accmode_t accmode;
struct nameidata nd, *ndp = &nd;
opts = mp->mnt_optnew;
@@ -265,10 +265,10 @@ ext2_mount(mp, td)
*
* XXXRW: VOP_ACCESS() enough?
*/
- accessmode = VREAD;
+ accmode = VREAD;
if ((mp->mnt_flag & MNT_RDONLY) == 0)
- accessmode |= VWRITE;
- error = VOP_ACCESS(devvp, accessmode, td->td_ucred, td);
+ accmode |= VWRITE;
+ error = VOP_ACCESS(devvp, accmode, td->td_ucred, td);
if (error)
error = priv_check(td, PRIV_VFS_MOUNT_PERM);
if (error) {
Modified: head/sys/gnu/fs/ext2fs/ext2_vnops.c
==============================================================================
--- head/sys/gnu/fs/ext2fs/ext2_vnops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/gnu/fs/ext2fs/ext2_vnops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -283,14 +283,14 @@ static int
ext2_access(ap)
struct vop_access_args /* {
struct vnode *a_vp;
- int a_mode;
+ accmode_t a_accmode;
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;
+ accmode_t accmode = ap->a_accmode;
int error;
if (vp->v_type == VBLK || vp->v_type == VCHR)
@@ -301,7 +301,7 @@ ext2_access(ap)
* unless the file is a socket, fifo, or a block or
* character device resident on the file system.
*/
- if (mode & VWRITE) {
+ if (accmode & VWRITE) {
switch (vp->v_type) {
case VDIR:
case VLNK:
@@ -315,11 +315,11 @@ ext2_access(ap)
}
/* If immutable bit set, nobody gets to write it. */
- if ((mode & VWRITE) && (ip->i_flags & (IMMUTABLE | SF_SNAPSHOT)))
+ if ((accmode & VWRITE) && (ip->i_flags & (IMMUTABLE | SF_SNAPSHOT)))
return (EPERM);
error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, ip->i_gid,
- ap->a_mode, ap->a_cred, NULL);
+ ap->a_accmode, ap->a_cred, NULL);
return (error);
}
Modified: head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c
==============================================================================
--- head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/gnu/fs/reiserfs/reiserfs_vfsops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -74,7 +74,7 @@ reiserfs_mount(struct mount *mp, struct
{
size_t size;
int error, len;
- mode_t accessmode;
+ accmode_t accmode;
char *path, *fspec;
struct vnode *devvp;
struct vfsoptlist *opts;
@@ -124,10 +124,10 @@ reiserfs_mount(struct mount *mp, struct
/* If mount by non-root, then verify that user has necessary
* permissions on the device. */
- accessmode = VREAD;
+ accmode = VREAD;
if ((mp->mnt_flag & MNT_RDONLY) == 0)
- accessmode |= VWRITE;
- error = VOP_ACCESS(devvp, accessmode, td->td_ucred, td);
+ accmode |= VWRITE;
+ error = VOP_ACCESS(devvp, accmode, td->td_ucred, td);
if (error)
error = priv_check(td, PRIV_VFS_MOUNT_PERM);
if (error) {
Modified: head/sys/gnu/fs/reiserfs/reiserfs_vnops.c
==============================================================================
--- head/sys/gnu/fs/reiserfs/reiserfs_vnops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/gnu/fs/reiserfs/reiserfs_vnops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -57,14 +57,14 @@ reiserfs_access(struct vop_access_args *
int error;
struct vnode *vp = ap->a_vp;
struct reiserfs_node *ip = VTOI(vp);
- mode_t mode = ap->a_mode;
+ accmode_t accmode = ap->a_accmode;
/*
* Disallow write attempts on read-only file systems; unless the file
* is a socket, fifo, or a block or character device resident on the
* file system.
*/
- if (mode & VWRITE) {
+ if (accmode & VWRITE) {
switch (vp->v_type) {
case VDIR:
case VLNK:
@@ -81,13 +81,13 @@ reiserfs_access(struct vop_access_args *
}
/* If immutable bit set, nobody gets to write it. */
- if ((mode & VWRITE) && (ip->i_flags & (IMMUTABLE | SF_SNAPSHOT))) {
+ if ((accmode & VWRITE) && (ip->i_flags & (IMMUTABLE | SF_SNAPSHOT))) {
reiserfs_log(LOG_DEBUG, "no write access (immutable)\n");
return (EPERM);
}
error = vaccess(vp->v_type, ip->i_mode, ip->i_uid, ip->i_gid,
- ap->a_mode, ap->a_cred, NULL);
+ ap->a_accmode, ap->a_cred, NULL);
return (error);
}
Modified: head/sys/gnu/fs/xfs/FreeBSD/xfs_super.c
==============================================================================
--- head/sys/gnu/fs/xfs/FreeBSD/xfs_super.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/gnu/fs/xfs/FreeBSD/xfs_super.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -133,7 +133,7 @@ xfs_blkdev_get(
struct vnode *devvp;
struct g_consumer *cp;
struct g_provider *pp;
- mode_t accessmode;
+ accmode_t accmode;
td = curthread;
@@ -151,10 +151,10 @@ xfs_blkdev_get(
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY);
ronly = ((XFS_MTOVFS(mp)->vfs_flag & VFS_RDONLY) != 0);
- accessmode = VREAD;
+ accmode = VREAD;
if (!ronly)
- accessmode |= VWRITE;
- error = VOP_ACCESS(devvp, accessmode, td->td_ucred, td);
+ accmode |= VWRITE;
+ error = VOP_ACCESS(devvp, accmode, td->td_ucred, td);
if (error)
error = priv_check(td, PRIV_VFS_MOUNT_PERM);
if (error) {
Modified: head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c
==============================================================================
--- head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/gnu/fs/xfs/FreeBSD/xfs_vnops.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -180,14 +180,14 @@ static int
_xfs_access(
struct vop_access_args /* {
struct vnode *a_vp;
- int a_mode;
+ accmode_t a_accmode;
struct ucred *a_cred;
struct thread *a_td;
} */ *ap)
{
int error;
- XVOP_ACCESS(VPTOXFSVP(ap->a_vp), ap->a_mode, ap->a_cred, error);
+ XVOP_ACCESS(VPTOXFSVP(ap->a_vp), ap->a_accmode, ap->a_cred, error);
return (error);
}
Modified: head/sys/kern/subr_acl_posix1e.c
==============================================================================
--- head/sys/kern/subr_acl_posix1e.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/kern/subr_acl_posix1e.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -53,12 +53,12 @@ __FBSDID("$FreeBSD$");
*/
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, accmode_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;
+ accmode_t dac_granted;
+ accmode_t priv_granted;
+ accmode_t acl_mask_granted;
int group_matched, i;
/*
Modified: head/sys/kern/uipc_mqueue.c
==============================================================================
--- head/sys/kern/uipc_mqueue.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/kern/uipc_mqueue.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -1120,7 +1120,7 @@ mqfs_close(struct vop_close_args *ap)
struct vop_access_args {
struct vop_generic_args a_gen;
struct vnode *a_vp;
- int a_mode;
+ accmode_t a_accmode;
struct ucred *a_cred;
struct thread *a_td;
};
@@ -1140,7 +1140,7 @@ mqfs_access(struct vop_access_args *ap)
if (error)
return (error);
error = vaccess(vp->v_type, vattr.va_mode, vattr.va_uid,
- vattr.va_gid, ap->a_mode, ap->a_cred, NULL);
+ vattr.va_gid, ap->a_accmode, ap->a_cred, NULL);
return (error);
}
@@ -2003,14 +2003,14 @@ kmq_open(struct thread *td, struct kmq_o
if ((flags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) {
error = EEXIST;
} else {
- int acc_mode = 0;
+ accmode_t accmode = 0;
if (flags & FREAD)
- acc_mode |= VREAD;
+ accmode |= VREAD;
if (flags & FWRITE)
- acc_mode |= VWRITE;
+ accmode |= VWRITE;
error = vaccess(VREG, pn->mn_mode, pn->mn_uid,
- pn->mn_gid, acc_mode, td->td_ucred, NULL);
+ pn->mn_gid, accmode, td->td_ucred, NULL);
}
}
Modified: head/sys/kern/uipc_shm.c
==============================================================================
--- head/sys/kern/uipc_shm.c Tue Oct 28 12:49:07 2008 (r184412)
+++ head/sys/kern/uipc_shm.c Tue Oct 28 13:44:11 2008 (r184413)
@@ -367,15 +367,15 @@ shm_drop(struct shmfd *shmfd)
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-head
mailing list