1ACL_GET_ENTRY(3)         BSD Library Functions Manual         ACL_GET_ENTRY(3)
2

NAME

4     acl_get_entry — get an ACL entry
5

LIBRARY

7     Linux Access Control Lists library (libacl, -lacl).
8

SYNOPSIS

10     #include <sys/types.h>
11     #include <sys/acl.h>
12
13     int
14     acl_get_entry(acl_t acl, int entry_id, acl_entry_t *entry_p);
15

DESCRIPTION

17     The acl_get_entry() function obtains a descriptor for an ACL entry as
18     specified by entry_id within the ACL indicated by the argument acl.  If
19     the value of entry_id is ACL_FIRST_ENTRY, then the function returns in
20     entry_p a descriptor for the first ACL entry within acl.  If the value of
21     entry_id is ACL_NEXT_ENTRY, then the function returns in entry_p a de‐
22     scriptor for the next ACL entry within acl.
23
24     If a call is made to acl_get_entry() with entry_id set to ACL_NEXT_ENTRY
25     when there has not been either an initial successful call to
26     acl_get_entry(), or a previous successful call to acl_get_entry() follow‐
27     ing a call to acl_calc_mask(), acl_copy_int(), acl_create_entry(),
28     acl_delete_entry(), acl_dup(), acl_from_text(), acl_get_fd(),
29     acl_get_file(), acl_set_fd(), acl_set_file(), or acl_valid(), then the
30     effect is unspecified.
31
32     Calls to acl_get_entry() do not modify any ACL entries. Subsequent opera‐
33     tions using the returned ACL entry descriptor operate on the ACL entry
34     within the ACL in working storage. The order of all existing entries in
35     the ACL remains unchanged.  Any existing ACL entry descriptors that refer
36     to entries within the ACL continue to refer to those entries. Any exist‐
37     ing ACL pointers that refer to the ACL referred to by acl continue to re‐
38     fer to the ACL.
39

RETURN VALUE

41     If the function successfully obtains an ACL entry, the function returns a
42     value of 1.  If the ACL has no ACL entries, the function returns the
43     value 0.  If the value of entry_id is ACL_NEXT_ENTRY and the last ACL en‐
44     try in the ACL has already been returned by a previous call to
45     acl_get_entry(), the function returns the value 0 until a successful call
46     with an entry_id of ACL_FIRST_ENTRY is made. Otherwise, the value -1 is
47     returned and errno is set to indicate the error.
48

ERRORS

50     If any of the following conditions occur, the acl_get_entry() function
51     returns -1 and sets errno to the corresponding value:
52
53     [EINVAL]           The argument acl_p is not a valid pointer to an ACL.
54
55                        The argument entry_id is neither ACL_NEXT_ENTRY nor
56                        ACL_FIRST_ENTRY.
57

STANDARDS

59     IEEE Std 1003.1e draft 17 (“POSIX.1e”, abandoned)
60

SEE ALSO

62     acl_calc_mask(3), acl_create_entry(3), acl_copy_entry(3),
63     acl_delete_entry(3), acl_get_file(3), acl(5)
64

AUTHOR

66     Derived from the FreeBSD manual pages written by Robert N M Watson
67     <rwatson@FreeBSD.org>, and adapted for Linux by Andreas Gruenbacher
68     <andreas.gruenbacher@gmail.com>.
69
70Linux ACL                       March 23, 2002                       Linux ACL
Impressum