mirror of https://github.com/mkerrisk/man-pages
access.2: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
c63f06b5ff
commit
4ba0bbdef5
|
@ -46,21 +46,21 @@ access, faccessat \- check user's permissions for a file
|
|||
.SH SYNOPSIS
|
||||
.nf
|
||||
.B #include <unistd.h>
|
||||
.sp
|
||||
.PP
|
||||
.BI "int access(const char *" pathname ", int " mode );
|
||||
|
||||
.BR "#include <fcntl.h> " "/* Definition of AT_* constants */"
|
||||
.B #include <unistd.h>
|
||||
.sp
|
||||
.PP
|
||||
.BI "int faccessat(int " dirfd ", const char *" pathname ", int " \
|
||||
mode ", int " flags );
|
||||
.fi
|
||||
.sp
|
||||
.PP
|
||||
.in -4n
|
||||
Feature Test Macro Requirements for glibc (see
|
||||
.BR feature_test_macros (7)):
|
||||
.in
|
||||
.sp
|
||||
.PP
|
||||
.BR faccessat ():
|
||||
.PD 0
|
||||
.ad l
|
||||
|
@ -82,7 +82,7 @@ checks whether the calling process can access the file
|
|||
If
|
||||
.I pathname
|
||||
is a symbolic link, it is dereferenced.
|
||||
|
||||
.PP
|
||||
The
|
||||
.I mode
|
||||
specifies the accessibility check(s) to be performed,
|
||||
|
@ -96,7 +96,7 @@ tests for the existence of the file.
|
|||
.BR R_OK ", " W_OK ", and " X_OK
|
||||
test whether the file exists and grants read, write, and
|
||||
execute permissions, respectively.
|
||||
|
||||
.PP
|
||||
The check is done using the calling process's
|
||||
.I real
|
||||
UID and GID, rather than the effective IDs as is done when
|
||||
|
@ -107,7 +107,7 @@ Similarly, for the root user, the check uses the set of
|
|||
permitted capabilities rather than the set of effective
|
||||
capabilities; and for non-root users, the check uses an empty set
|
||||
of capabilities.
|
||||
|
||||
.PP
|
||||
This allows set-user-ID programs and capability-endowed programs
|
||||
to easily determine the invoking user's authority.
|
||||
In other words,
|
||||
|
@ -120,7 +120,7 @@ read/write/execute this file?",
|
|||
which gives set-user-ID programs the possibility to
|
||||
prevent malicious users from causing them to read files
|
||||
which users shouldn't be able to read.
|
||||
|
||||
.PP
|
||||
If the calling process is privileged (i.e., its real UID is zero),
|
||||
then an
|
||||
.B X_OK
|
||||
|
@ -132,7 +132,7 @@ The
|
|||
system call operates in exactly the same way as
|
||||
.BR access (),
|
||||
except for the differences described here.
|
||||
|
||||
.PP
|
||||
If the pathname given in
|
||||
.I pathname
|
||||
is relative, then it is interpreted relative to the directory
|
||||
|
@ -142,7 +142,7 @@ referred to by the file descriptor
|
|||
the calling process, as is done by
|
||||
.BR access ()
|
||||
for a relative pathname).
|
||||
|
||||
.PP
|
||||
If
|
||||
.I pathname
|
||||
is relative and
|
||||
|
@ -154,13 +154,13 @@ then
|
|||
is interpreted relative to the current working
|
||||
directory of the calling process (like
|
||||
.BR access ()).
|
||||
|
||||
.PP
|
||||
If
|
||||
.I pathname
|
||||
is absolute, then
|
||||
.I dirfd
|
||||
is ignored.
|
||||
|
||||
.PP
|
||||
.I flags
|
||||
is constructed by ORing together zero or more of the following values:
|
||||
.TP
|
||||
|
@ -277,7 +277,7 @@ library support was added to glibc in version 2.4.
|
|||
.SH CONFORMING TO
|
||||
.BR access ():
|
||||
SVr4, 4.3BSD, POSIX.1-2001, POSIX.1-2008.
|
||||
|
||||
.PP
|
||||
.BR faccessat ():
|
||||
POSIX.1-2008.
|
||||
.SH NOTES
|
||||
|
@ -392,7 +392,7 @@ returns 0 for such files.
|
|||
.\" This behavior appears to have been an implementation accident.
|
||||
Early 2.6 kernels (up to and including 2.6.3)
|
||||
also behaved in the same way as kernel 2.4.
|
||||
|
||||
.PP
|
||||
In kernels before 2.6.20,
|
||||
these calls ignored the effect of the
|
||||
.B MS_NOEXEC
|
||||
|
|
Loading…
Reference in New Issue