access.2: ffix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-08-15 08:29:00 +02:00
parent c63f06b5ff
commit 4ba0bbdef5
1 changed files with 14 additions and 14 deletions

View File

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