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

NAME

4     acl_to_any_text — convert an ACL to text
5

LIBRARY

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

SYNOPSIS

10     #include <sys/types.h>
11     #include <acl/libacl.h>
12
13     char *
14     acl_to_any_text(acl_t acl, const char *prefix, char separator,
15         int options);
16

DESCRIPTION

18     The acl_to_any_text() function translates the ACL pointed to by the argu‐
19     ment acl into a NULL terminated character string. This character string
20     is composed of the ACL entries contained in acl, in the entry text format
21     described on acl(5).  Entries are separated from each other by the
22     separator character. If the argument prefix is not (const char *)NULL,
23     each entry is prefixed by this character string.
24
25     If the argument options is 0, ACL entries are converted using the entry
26     tag type keywords user, group, mask, and other.  User IDs and group IDs
27     of ACL entries that contain such qualifiers are converted to their corre‐
28     sponding names; if an identifier has no corresponding name, a decimal
29     number string is produced. The ACL text representation contains no addi‐
30     tional comments.  A bitwise combinations of the following options can be
31     used to modify the result:
32
33     TEXT_ABBREVIATE
34             Instead of the full tag type keywords, single letter abbrevia‐
35             tions are used.  The abbreviation for user is u, the abbreviation
36             for group is g, the abbreviation for mask is m, and the abbrevia‐
37             tion for other is o.
38
39     TEXT_NUMERIC_IDS
40             User IDs and group IDs are included as decimal numbers instead of
41             names.
42
43     TEXT_SOME_EFFECTIVE
44             A comment containing the effective permissions of the ACL entry
45             is included after ACL entries that contain permissions which are
46             ineffective because they are masked by an ACL_MASK entry. The ACL
47             entry and the comment are separated by a tab character.
48
49     TEXT_ALL_EFFECTIVE
50             A comment containing the effective permissions of the ACL entry
51             is included after all ACL entries that are affected by an
52             ACL_MASK entry.  The comment is included even if the permissions
53             contained in the ACL entry equal the effective permissions. The
54             ACL entry and the comment are separated by a tab character.
55
56     TEXT_SMART_INDENT
57             This option is used in combination with the TEXT_SOME_EFFECTIVE
58             or TEXT_ALL_EFFECTIVE option. The number of tab characters in‐
59             serted between the ACL entry and the comment is increased so that
60             the comment is aligned to the fourth tab stop position.  A tab
61             width of 8 characters is assumed.
62
63     The ACL referred to by acl is not changed.
64
65     This function allocates any memory necessary to contain the string and
66     returns a pointer to the string.  The caller should free any releasable
67     memory, when the new string is no longer required, by calling acl_free()
68     with the (void*)char returned by acl_to_any_text() as an argument.
69

RETURN VALUE

71     On success, this function returns a pointer to the text representation of
72     the ACL.  On error, a value of (char *)NULL is returned, and errno is set
73     appropriately.
74

ERRORS

76     If any of the following conditions occur, the acl_to_any_text() function
77     returns a value of (char *)NULL and sets errno to the corresponding
78     value:
79
80     [EINVAL]           The argument acl is not a valid pointer to an ACL.
81
82                        The ACL referenced by acl contains one or more improp‐
83                        erly formed ACL entries, or for some other reason can‐
84                        not be translated into the text form of an ACL.
85
86     [ENOMEM]           The character string to be returned requires more mem‐
87                        ory than is allowed by the hardware or system-imposed
88                        memory management constraints.
89

STANDARDS

91     This is a non-portable, Linux specific extension to the ACL manipulation
92     functions defined in IEEE Std 1003.1e draft 17 (“POSIX.1e”, abandoned).
93

SEE ALSO

95     acl_from_text(3), acl_to_text(3), acl_free(3), acl(5)
96

AUTHOR

98     Written by Andreas Gruenbacher <andreas.gruenbacher@gmail.com>.
99
100Linux ACL                       March 25, 2002                       Linux ACL
Impressum