2007-05-06 08:32:47 +00:00
|
|
|
.\" Hey Emacs! This file is -*- nroff -*- source.
|
|
|
|
.\"
|
2007-09-20 06:52:22 +00:00
|
|
|
.\" Copyright (C) 2007 Michael Kerrisk <mtk.manpages@gmail.com>
|
2007-05-06 08:32:47 +00:00
|
|
|
.\"
|
|
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
|
|
.\" preserved on all copies.
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
|
|
.\" permission notice identical to this one.
|
|
|
|
.\"
|
|
|
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
|
|
.\" have taken the same level of care in the production of this manual,
|
|
|
|
.\" which is licensed free of charge, as they might when working
|
|
|
|
.\" professionally.
|
|
|
|
.\"
|
|
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
|
|
.\" the source, must acknowledge the copyright and authors of this work.
|
|
|
|
.\"
|
|
|
|
.\"
|
accept.2, clone.2, dup.2, fallocate.2, pipe.2, readahead.2, sched_setaffinity.2, unshare.2, CPU_SET.3, endian.3, euidaccess.3, fexecve.3, getpt.3, getpw.3, getumask.3, getutmp.3, gnu_get_libc_version.3, makedev.3, matherr.3, mbsnrtowcs.3, memfrob.3, pthread_attr_setaffinity_np.3, pthread_getattr_np.3, pthread_setaffinity_np.3, pthread_tryjoin_np.3, tcgetsid.3, wcscasecmp.3, wcsncasecmp.3, wcsnlen.3, wcsnrtombs.3, wcswidth.3, rtld-audit.7: SYNOPSIS: Add reference to feature_test_macros(7)
These pages specify feature test macros in the function
prototypes. Add a reference to feature_test_macros(7),
so that readers are pointed to the information that
feature test macros must be defined before including
*any* header file.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-09-10 05:06:22 +00:00
|
|
|
.TH EUIDACCESS 3 2010-09-10 "" "Linux Programmer's Manual"
|
2007-05-06 08:32:47 +00:00
|
|
|
.SH NAME
|
|
|
|
euidaccess, eaccess \- check effective user's permissions for a file
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
accept.2, clone.2, dup.2, fallocate.2, pipe.2, readahead.2, sched_setaffinity.2, unshare.2, CPU_SET.3, endian.3, euidaccess.3, fexecve.3, getpt.3, getpw.3, getumask.3, getutmp.3, gnu_get_libc_version.3, makedev.3, matherr.3, mbsnrtowcs.3, memfrob.3, pthread_attr_setaffinity_np.3, pthread_getattr_np.3, pthread_setaffinity_np.3, pthread_tryjoin_np.3, tcgetsid.3, wcscasecmp.3, wcsncasecmp.3, wcsnlen.3, wcsnrtombs.3, wcswidth.3, rtld-audit.7: SYNOPSIS: Add reference to feature_test_macros(7)
These pages specify feature test macros in the function
prototypes. Add a reference to feature_test_macros(7),
so that readers are pointed to the information that
feature test macros must be defined before including
*any* header file.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-09-10 05:06:22 +00:00
|
|
|
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
|
2007-05-06 08:32:47 +00:00
|
|
|
.B #include <unistd.h>
|
|
|
|
.sp
|
|
|
|
.BI "int euidaccess(const char *" pathname ", int " mode );
|
|
|
|
.BI "int eaccess(const char *" pathname ", int " mode );
|
|
|
|
.fi
|
|
|
|
.SH DESCRIPTION
|
|
|
|
Like
|
2007-05-12 00:30:29 +00:00
|
|
|
.BR access (2),
|
2007-05-06 08:32:47 +00:00
|
|
|
.BR euidaccess ()
|
|
|
|
checks permissions and existence of the file identified by its argument
|
|
|
|
.IR pathname .
|
2007-06-21 22:55:04 +00:00
|
|
|
However, whereas
|
2007-05-12 00:30:29 +00:00
|
|
|
.BR access (2),
|
2007-05-06 08:32:47 +00:00
|
|
|
performs checks using the real user and group identifiers of the process,
|
|
|
|
.BR euidaccess ()
|
|
|
|
uses the effective identifiers.
|
|
|
|
|
|
|
|
.I mode
|
|
|
|
is a mask consisting of one or more of
|
|
|
|
.BR R_OK ", " W_OK ", " X_OK " and " F_OK ,
|
2007-06-21 22:55:04 +00:00
|
|
|
with the same meanings as for
|
2007-05-12 00:30:29 +00:00
|
|
|
.BR access (2).
|
2007-05-06 08:32:47 +00:00
|
|
|
|
|
|
|
.BR eaccess ()
|
|
|
|
is a synonym for
|
|
|
|
.BR euidaccess (),
|
|
|
|
provided for compatibility with some other systems.
|
|
|
|
.SH "RETURN VALUE"
|
|
|
|
On success (all requested permissions granted), zero is returned.
|
|
|
|
On error (at least one bit in
|
|
|
|
.I mode
|
|
|
|
asked for a permission that is denied, or some other error occurred),
|
|
|
|
\-1 is returned, and
|
|
|
|
.I errno
|
|
|
|
is set appropriately.
|
|
|
|
.SH ERRORS
|
|
|
|
As for
|
2007-05-12 00:30:29 +00:00
|
|
|
.BR access (2).
|
2007-07-18 20:26:32 +00:00
|
|
|
.SH VERSIONS
|
|
|
|
The
|
|
|
|
.BR eaccess ()
|
|
|
|
function was added to glibc in version 2.4.
|
2007-05-06 08:32:47 +00:00
|
|
|
.SH "CONFORMING TO"
|
accept.2, execve.2, futimesat.2, getresuid.2, getrlimit.2, madvise.2, mq_getsetattr.2, msgctl.2, nice.2, open.2, poll.2, setresuid.2, shmctl.2, sigaction.2, times.2, utimensat.2, __setfpucw.3, atoi.3, endian.3, err.3, euidaccess.3, fenv.3, fopencookie.3, fpurge.3, getgrouplist.3, getutmp.3, j0.3, lgamma.3, netlink.3, pthread_attr_init.3, pthread_attr_setaffinity_np.3, pthread_cleanup_push_defer_np.3, pthread_getattr_np.3, pthread_kill_other_threads_np.3, pthread_setaffinity_np.3, pthread_tryjoin_np.3, pthread_yield.3, random_r.3, readdir.3, rtnetlink.3, scanf.3, setenv.3, significand.3, sigsetops.3, strerror.3, strstr.3, sysv_signal.3, termios.3, timegm.3, unlocked_stdio.3, y0.3, locale.5, bootparam.7, feature_test_macros.7, ip.7, locale.7, pthreads.7, rtld-audit.7, nscd.8: Global fix: s/non-standard/nonstandard/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "non-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 16:37:52 +00:00
|
|
|
These functions are nonstandard.
|
2007-05-06 08:32:47 +00:00
|
|
|
Some other systems have an
|
|
|
|
.\" e.g., FreeBSD 6.1.
|
|
|
|
.BR eaccess ()
|
|
|
|
function.
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR access (2),
|
|
|
|
.BR chmod (2),
|
|
|
|
.BR chown (2),
|
|
|
|
.BR faccessat (2),
|
|
|
|
.BR open (2),
|
|
|
|
.BR setgid (2),
|
|
|
|
.BR setuid (2),
|
2007-05-26 12:41:39 +00:00
|
|
|
.BR stat (2),
|
2007-06-08 07:57:18 +00:00
|
|
|
.BR credentials (7),
|
2007-05-26 12:41:39 +00:00
|
|
|
.BR path_resolution (7)
|