diff options
Diffstat (limited to 'share')
-rw-r--r-- | share/man/man9/VOP_ACCESS.9 | 34 | ||||
-rw-r--r-- | share/man/man9/vaccess.9 | 4 | ||||
-rw-r--r-- | share/man/man9/vaccess_acl_posix1e.9 | 4 |
3 files changed, 21 insertions, 21 deletions
diff --git a/share/man/man9/VOP_ACCESS.9 b/share/man/man9/VOP_ACCESS.9 index 55a9302..73eb2b5 100644 --- a/share/man/man9/VOP_ACCESS.9 +++ b/share/man/man9/VOP_ACCESS.9 @@ -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 returned. .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, struct ucred *cred, struct thread *td) * 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, struct ucred *cred, struct thread *td) } /* 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, struct ucred *cred, struct thread *td) /* 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, struct ucred *cred, struct thread *td) /* 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); } diff --git a/share/man/man9/vaccess.9 b/share/man/man9/vaccess.9 index f5d6664..5315d98 100644 --- a/share/man/man9/vaccess.9 +++ b/share/man/man9/vaccess.9 @@ -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 diff --git a/share/man/man9/vaccess_acl_posix1e.9 b/share/man/man9/vaccess_acl_posix1e.9 index 24193d4..0610511 100644 --- a/share/man/man9/vaccess_acl_posix1e.9 +++ b/share/man/man9/vaccess_acl_posix1e.9 @@ -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 |