Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/sys/access.2
Show All 22 Lines | |||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" 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 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" @(#)access.2 8.2 (Berkeley) 4/1/94 | .\" @(#)access.2 8.2 (Berkeley) 4/1/94 | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd September 15, 2014 | .Dd October 20, 2018 | ||||
.Dt ACCESS 2 | .Dt ACCESS 2 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm access , | .Nm access , | ||||
.Nm eaccess , | .Nm eaccess , | ||||
.Nm faccessat | .Nm faccessat | ||||
.Nd check accessibility of a file | .Nd check accessibility of a file | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | |||||
are constructed by a bitwise-inclusive OR of flags from the following | are constructed by a bitwise-inclusive OR of flags from the following | ||||
list, defined in | list, defined in | ||||
.In fcntl.h : | .In fcntl.h : | ||||
.Bl -tag -width indent | .Bl -tag -width indent | ||||
.It Dv AT_EACCESS | .It Dv AT_EACCESS | ||||
The checks for accessibility are performed using the effective user and group | The checks for accessibility are performed using the effective user and group | ||||
IDs instead of the real user and group ID as required in a call to | IDs instead of the real user and group ID as required in a call to | ||||
.Fn access . | .Fn access . | ||||
.It Dv AT_BENEATH | |||||
Do not allow to check a file which is not a child of the starting directory. | |||||
emaste: I would rephrase these to avoid the negative - something like "Only allow operation on a file… | |||||
jonathanUnsubmitted Done Inline ActionsThis might be clearer if it said something like, "Only operate on files and directories within the starting directory". jonathan: This might be clearer if it said something like, "Only operate on files and directories within… | |||||
.El | .El | ||||
.Pp | .Pp | ||||
Even if a process's real or effective user has appropriate privileges | Even if a process's real or effective user has appropriate privileges | ||||
and indicates success for | and indicates success for | ||||
.Dv X_OK , | .Dv X_OK , | ||||
the file may not actually have execute permission bits set. | the file may not actually have execute permission bits set. | ||||
Likewise for | Likewise for | ||||
.Dv R_OK | .Dv R_OK | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | |||||
.It Bq Er ENOTDIR | .It Bq Er ENOTDIR | ||||
The | The | ||||
.Fa path | .Fa path | ||||
argument is not an absolute path and | argument is not an absolute path and | ||||
.Fa fd | .Fa fd | ||||
is neither | is neither | ||||
.Dv AT_FDCWD | .Dv AT_FDCWD | ||||
nor a file descriptor associated with a directory. | nor a file descriptor associated with a directory. | ||||
.It Bq Er ENOTCAPABLE | |||||
jonathanUnsubmitted Done Inline ActionsI might suggest: .Dv AT_BENEATH was specified but .Fa path is not strictly relative to the starting directory. For example, .Fa path is absolute or includes a ".." component that escapes the starting directory. jonathan: I might suggest:
```
.Dv AT_BENEATH
was specified but
.Fa path
is not strictly relative to the… | |||||
.Fa path | |||||
was absolute or a ".." component leading to a directory outside of | |||||
the directory hierarchy rooted by the start directory, and the | |||||
.Dv AT_BENEATH | |||||
flag was specified. | |||||
.El | .El | ||||
.Sh SEE ALSO | .Sh SEE ALSO | ||||
.Xr chmod 2 , | .Xr chmod 2 , | ||||
.Xr intro 2 , | .Xr intro 2 , | ||||
.Xr stat 2 | .Xr stat 2 | ||||
.Sh STANDARDS | .Sh STANDARDS | ||||
The | The | ||||
.Fn access | .Fn access | ||||
Show All 38 Lines |
I would rephrase these to avoid the negative - something like "Only allow operation on a file which is a child of the starting directory."