OSDN Git Service

(split) LDP man-pages の original/ を v3.30 に更新。
[linuxjm/LDP_man-pages.git] / original / man2 / access.2
index 20a3fd3..2312850 100644 (file)
@@ -40,7 +40,7 @@
 .\" Modified 2004-06-23 by Michael Kerrisk
 .\" 2007-06-10, mtk, various parts rewritten, and added BUGS section.
 .\"
-.TH ACCESS 2 2007-07-10 "Linux" "Linux Programmer's Manual"
+.TH ACCESS 2 2010-10-24 "Linux" "Linux Programmer's Manual"
 .SH NAME
 access \- check real user's permissions for a file
 .SH SYNOPSIS
@@ -158,6 +158,17 @@ open a file before actually doing so using
 creates a security hole, because the user might exploit the short time
 interval between checking and opening the file to manipulate it.
 .BR "For this reason, the use of this system call should be avoided" .
+(In the example just described,
+a safer alternative would be to temporarily switch the process's
+effective user ID to the real ID and then call
+.BR open (2).)
+.PP
+.BR access ()
+always dereferences symbolic links.
+If you need to check the permissions on a symbolic link, use
+.BR faccessat(2)
+with the flag
+.BR AT_SYMLINK_NOFOLLOW .
 .PP
 .BR access ()
 returns an error if any of the access types in
@@ -167,7 +178,7 @@ is denied, even if some of the other access types in
 are permitted.
 .PP
 If the calling process has appropriate privileges (i.e., is superuser),
-POSIX.1-2001 permits implementation to indicate success for an
+POSIX.1-2001 permits an implementation to indicate success for an
 .B X_OK
 check even if none of the execute file permission bits are set.
 .\" HPU-UX 11 and Tru64 5.1 do this.