diff options
author | trasz <trasz@FreeBSD.org> | 2008-10-28 13:44:11 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2008-10-28 13:44:11 +0000 |
commit | 0ad8692247694171bf2d3f963f24b15f5223a0de (patch) | |
tree | cb5d9bbe34cd6eae2c3dd212bdfdfd85569424dd /sys/kern/vfs_vnops.c | |
parent | bc6713490924420312442a3f3fc4ef1fe4b8e400 (diff) | |
download | FreeBSD-src-0ad8692247694171bf2d3f963f24b15f5223a0de.zip FreeBSD-src-0ad8692247694171bf2d3f963f24b15f5223a0de.tar.gz |
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)
Diffstat (limited to 'sys/kern/vfs_vnops.c')
-rw-r--r-- | sys/kern/vfs_vnops.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 5eac785..ef22413 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -115,7 +115,8 @@ vn_open_cred(ndp, flagp, cmode, cred, fp) struct thread *td = ndp->ni_cnd.cn_thread; struct vattr vat; struct vattr *vap = &vat; - int mode, fmode, error; + int fmode, error; + accmode_t accmode; int vfslocked, mpsafe; mpsafe = ndp->ni_cnd.cn_flags & MPSAFE; @@ -202,33 +203,33 @@ restart: error = EOPNOTSUPP; goto bad; } - mode = 0; + accmode = 0; if (fmode & (FWRITE | O_TRUNC)) { if (vp->v_type == VDIR) { error = EISDIR; goto bad; } - mode |= VWRITE; + accmode |= VWRITE; } if (fmode & FREAD) - mode |= VREAD; + accmode |= VREAD; if (fmode & FEXEC) - mode |= VEXEC; + accmode |= VEXEC; if (fmode & O_APPEND) - mode |= VAPPEND; + accmode |= VAPPEND; #ifdef MAC - error = mac_vnode_check_open(cred, vp, mode); + error = mac_vnode_check_open(cred, vp, accmode); if (error) goto bad; #endif if ((fmode & O_CREAT) == 0) { - if (mode & VWRITE) { + if (accmode & VWRITE) { error = vn_writechk(vp); if (error) goto bad; } - if (mode) { - error = VOP_ACCESS(vp, mode, cred, td); + if (accmode) { + error = VOP_ACCESS(vp, accmode, cred, td); if (error) goto bad; } |