1997-03-03 18:01:01 +00:00
|
|
|
.\" -*- nroff -*-
|
|
|
|
.\" -*- nroff -*-
|
|
|
|
.\"
|
|
|
|
.\" Copyright (c) 1996 Doug Rabson
|
|
|
|
.\"
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This program is free software.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
1999-08-28 00:22:10 +00:00
|
|
|
.\" $FreeBSD$
|
1997-03-03 18:01:01 +00:00
|
|
|
.\"
|
2009-09-22 15:15:03 +00:00
|
|
|
.Dd September 18, 2009
|
1997-03-03 18:01:01 +00:00
|
|
|
.Dt VOP_ACCESS 9
|
2010-04-14 19:08:06 +00:00
|
|
|
.Os
|
1997-03-03 18:01:01 +00:00
|
|
|
.Sh NAME
|
2009-05-30 13:59:05 +00:00
|
|
|
.Nm VOP_ACCESS ,
|
|
|
|
.Nm VOP_ACCESSX
|
2000-05-09 14:02:06 +00:00
|
|
|
.Nd "check access permissions of a file or Unix domain socket"
|
1997-03-03 18:01:01 +00:00
|
|
|
.Sh SYNOPSIS
|
2001-10-01 16:09:29 +00:00
|
|
|
.In sys/param.h
|
|
|
|
.In sys/vnode.h
|
1997-03-03 18:01:01 +00:00
|
|
|
.Ft int
|
2008-10-28 13:44:11 +00:00
|
|
|
.Fn VOP_ACCESS "struct vnode *vp" "accmode_t accmode" "struct ucred *cred" "struct thread *td"
|
2009-05-30 13:59:05 +00:00
|
|
|
.Ft int
|
|
|
|
.Fn VOP_ACCESSX "struct vnode *vp" "accmode_t accmode" "struct ucred *cred" "struct thread *td"
|
1997-03-03 18:01:01 +00:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
This entry point checks the access permissions of the file against the
|
|
|
|
given credentials.
|
|
|
|
.Pp
|
|
|
|
Its arguments are:
|
2008-10-28 13:44:11 +00:00
|
|
|
.Bl -tag -width accmode
|
2003-05-31 14:07:25 +00:00
|
|
|
.It Fa vp
|
2005-01-28 10:43:05 +00:00
|
|
|
The vnode of the file to check.
|
2008-10-28 13:44:11 +00:00
|
|
|
.It Fa accmode
|
2005-01-28 10:43:05 +00:00
|
|
|
The type of access required.
|
2003-05-31 14:07:25 +00:00
|
|
|
.It Fa cred
|
2005-01-28 10:43:05 +00:00
|
|
|
The user credentials to check.
|
2003-05-31 14:07:25 +00:00
|
|
|
.It Fa td
|
2005-01-28 10:43:05 +00:00
|
|
|
The thread which is checking.
|
1997-03-03 18:01:01 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
The
|
2008-10-28 13:44:11 +00:00
|
|
|
.Fa accmode
|
|
|
|
is a mask which can contain flags described in <sys/vnode.h>, e.g.
|
1997-03-03 18:01:01 +00:00
|
|
|
.Dv VREAD ,
|
2001-02-01 16:38:02 +00:00
|
|
|
.Dv VWRITE
|
|
|
|
or
|
|
|
|
.Dv VEXEC .
|
2009-05-30 13:59:05 +00:00
|
|
|
For
|
|
|
|
.Fn VOP_ACCESS ,
|
|
|
|
the only flags that may be set in
|
|
|
|
.Fa accmode
|
|
|
|
are
|
|
|
|
.Dv VEXEC ,
|
|
|
|
.Dv VWRITE ,
|
|
|
|
.Dv VREAD ,
|
|
|
|
.Dv VADMIN
|
|
|
|
and
|
|
|
|
.Dv VAPPEND .
|
2009-06-01 07:48:27 +00:00
|
|
|
To check for other flags, one has to use
|
2009-05-30 13:59:05 +00:00
|
|
|
.Fn VOP_ACCESSX
|
|
|
|
instead.
|
1997-03-03 18:01:01 +00:00
|
|
|
.Sh LOCKS
|
1999-09-24 13:58:55 +00:00
|
|
|
The vnode will be locked on entry and should remain locked on return.
|
1997-03-03 18:01:01 +00:00
|
|
|
.Sh RETURN VALUES
|
1997-03-04 06:20:48 +00:00
|
|
|
If the file is accessible in the specified way, then zero is returned,
|
1997-03-03 18:01:01 +00:00
|
|
|
otherwise an appropriate error code is returned.
|
|
|
|
.Sh ERRORS
|
1997-03-07 03:32:31 +00:00
|
|
|
.Bl -tag -width Er
|
1997-03-03 18:01:01 +00:00
|
|
|
.It Bq Er EPERM
|
2002-09-18 09:34:01 +00:00
|
|
|
An attempt was made to change an immutable file.
|
1997-03-03 18:01:01 +00:00
|
|
|
.It Bq Er EACCES
|
2002-09-18 22:12:43 +00:00
|
|
|
The permission bits the file mode or the ACL do not permit the
|
|
|
|
requested access.
|
1997-03-03 18:01:01 +00:00
|
|
|
.El
|
|
|
|
.Sh SEE ALSO
|
2001-12-22 03:20:24 +00:00
|
|
|
.Xr vaccess 9 ,
|
2009-09-22 15:15:03 +00:00
|
|
|
.Xr vaccess_acl_nfs4 9 ,
|
2001-12-22 03:20:24 +00:00
|
|
|
.Xr vaccess_acl_posix1e 9 ,
|
1997-03-03 18:01:01 +00:00
|
|
|
.Xr vnode 9
|
|
|
|
.Sh AUTHORS
|
2005-06-28 20:15:19 +00:00
|
|
|
This manual page was written by
|
1998-03-12 07:31:21 +00:00
|
|
|
.An Doug Rabson .
|