1ACL_TO_ANY_TEXT(3) BSD Library Functions Manual ACL_TO_ANY_TEXT(3)
2
4 acl_to_any_text — convert an ACL to text
5
7 Linux Access Control Lists library (libacl, -lacl).
8
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
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 abbre‐
35 viations are used. The abbreviation for user is u, the
36 abbreviation for group is g, the abbreviation for mask is
37 m, and the abbreviation for other is o.
38
39 TEXT_NUMERIC_IDS
40 User IDs and group IDs are included as decimal numbers
41 instead of names.
42
43 TEXT_SOME_EFFECTIVE
44 A comment containing the effective permissions of the ACL
45 entry is included after ACL entries that contain permis‐
46 sions which are ineffective because they are masked by an
47 ACL_MASK entry. The ACL entry and the comment are separated
48 by a tab character.
49
50 TEXT_ALL_EFFECTIVE
51 A comment containing the effective permissions of the ACL
52 entry is included after all ACL entries that are affected
53 by an ACL_MASK entry. The comment is included even if the
54 permissions contained in the ACL entry equal the effective
55 permissions. The ACL entry and the comment are separated by
56 a tab character.
57
58 TEXT_SMART_INDENT
59 This option is used in combination with the
60 TEXT_SOME_EFFECTIVE or TEXT_ALL_EFFECTIVE option. The num‐
61 ber of tab characters inserted between the ACL entry and
62 the comment is increased so that the comment is aligned to
63 the fourth tab stop position. A tab width of 8 characters
64 is assumed.
65
66 The ACL referred to by acl is not changed.
67
68 This function allocates any memory necessary to contain the string and
69 returns a pointer to the string. The caller should free any releasable
70 memory, when the new string is no longer required, by calling acl_free()
71 with the (void*)char returned by acl_to_any_text() as an argument.
72
74 On success, this function returns a pointer to the text representation of
75 the ACL. On error, a value of (char *)NULL is returned, and errno is set
76 appropriately.
77
79 If any of the following conditions occur, the acl_to_any_text() function
80 returns a value of (char *)NULL and sets errno to the corresponding
81 value:
82
83 [EINVAL] The argument acl is not a valid pointer to an ACL.
84
85 The ACL referenced by acl contains one or more improp‐
86 erly formed ACL entries, or for some other reason can‐
87 not be translated into the text form of an ACL.
88
89 [ENOMEM] The character string to be returned requires more mem‐
90 ory than is allowed by the hardware or system-imposed
91 memory management constraints.
92
94 This is a non-portable, Linux specific extension to the ACL manipulation
95 functions defined in IEEE Std 1003.1e draft 17 (“POSIX.1e”, abandoned).
96
98 acl_from_text(3), acl_to_text(3), acl_free(3), acl(5)
99
101 Written by Andreas Gruenbacher <a.gruenbacher@bestbits.at>.
102
103Linux ACL March 25, 2002 Linux ACL