1EUIDACCESS(3) Linux Programmer's Manual EUIDACCESS(3)
2
3
4
6 euidaccess, eaccess - check effective user's permissions for a file
7
9 #define _GNU_SOURCE /* See feature_test_macros(7) */
10 #include <unistd.h>
11
12 int euidaccess(const char *pathname, int mode);
13 int eaccess(const char *pathname, int mode);
14
16 Like access(2), euidaccess() checks permissions and existence of the
17 file identified by its argument pathname. However, whereas access(2),
18 performs checks using the real user and group identifiers of the
19 process, euidaccess() uses the effective identifiers.
20
21 mode is a mask consisting of one or more of R_OK, W_OK, X_OK and F_OK,
22 with the same meanings as for access(2).
23
24 eaccess() is a synonym for euidaccess(), provided for compatibility
25 with some other systems.
26
28 On success (all requested permissions granted), zero is returned. On
29 error (at least one bit in mode asked for a permission that is denied,
30 or some other error occurred), -1 is returned, and errno is set appro‐
31 priately.
32
34 As for access(2).
35
37 The eaccess() function was added to glibc in version 2.4.
38
40 These functions are nonstandard. Some other systems have an eaccess()
41 function.
42
44 Warning: Using this function to check a process's permissions on a file
45 before performing some operation based on that information leads to
46 race conditions: the file permissions may change between the two steps.
47 Generally, it is safer just to attempt the desired operation and handle
48 any permission error that occurs.
49
50 This function always dereferences symbolic links. If you need to check
51 the permissions on a symbolic link, use faccessat(2) with the flags
52 AT_EACCESS and AT_SYMLINK_NOFOLLOW.
53
55 access(2), chmod(2), chown(2), faccessat(2), open(2), setgid(2),
56 setuid(2), stat(2), credentials(7), path_resolution(7)
57
59 This page is part of release 3.53 of the Linux man-pages project. A
60 description of the project, and information about reporting bugs, can
61 be found at http://www.kernel.org/doc/man-pages/.
62
63
64
65 2010-11-01 EUIDACCESS(3)