1acltomode(3SEC) File Access Control Library Functions acltomode(3SEC)
2
3
4
6 acltomode, aclfrommode - convert an ACL to or from permission bits
7
9 cc [ flag... ] file... -lsec [ library... ]
10 #include <sys/types.h>
11 #include <sys/acl.h>
12
13
14
15 int acltomode(aclent_t *aclbufp, int nentries, mode_t *modep);
16
17
18 int aclfrommode(aclent_t *aclbufp, int nentries, mode_t *modep);
19
20
22 The acltomode() function converts an ACL pointed to by aclbufp into the
23 permission bits buffer pointed to by modep. If the USER_OBJ ACL entry,
24 GROUP_OBJ ACL entry, or the OTHER_OBJ ACL entry cannot be found in the
25 ACL buffer, then the function fails with errno set to EINVAL.
26
27
28 The USER_OBJ ACL entry permission bits are copied to the file owner
29 class bits in the permission bits buffer. The OTHER_OBJ ACL entry per‐
30 mission bits are copied to the file other class bits in the permission
31 bits buffer. If there is a CLASS_OBJ (ACL mask) entry, the CLASS_OBJ
32 ACL entry permission bits are copied to the file group class bits in
33 the permission bits buffer. Otherwise, the GROUP_OBJ ACL entry permis‐
34 sion bits are copied to the file group class bits in the permission
35 bits buffer.
36
37
38 The aclfrommode() function converts the permission bits pointed to by
39 modep into an ACL pointed to by aclbufp. If the USER_OBJ ACL entry,
40 GROUP_OBJ ACL entry, or the OTHER_OBJ ACL entry cannot be found in the
41 ACL buffer, the function fails with errno set to EINVAL.
42
43
44 The file owner class bits from the permission bits buffer are copied to
45 the USER_OBJ ACL entry. The file other class bits from the permission
46 bits buffer are copied to the OTHER_OBJ ACL entry. If there is a
47 CLASS_OBJ (ACL mask) entry, the file group class bits from the permis‐
48 sion bits buffer are copied to the CLASS_OBJ ACL entry, and the
49 GROUP_OBJ ACL entry is not modified. Otherwise, the file group class
50 bits from the permission bits buffer are copied to the GROUP_OBJ ACL
51 entry.
52
53
54 The nentries argument represents the number of ACL entries in the buf‐
55 fer pointed to by aclbufp.
56
58 Upon successful completion, the function returns 0. Otherwise, it
59 returns −1 and sets errno to indicate the error.
60
62 See attributes(5) for descriptions of the following attributes:
63
64
65
66
67 ┌─────────────────────────────┬─────────────────────────────┐
68 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
69 ├─────────────────────────────┼─────────────────────────────┤
70 │Interface Stability │Evolving │
71 ├─────────────────────────────┼─────────────────────────────┤
72 │MT-Level │Unsafe │
73 └─────────────────────────────┴─────────────────────────────┘
74
76 acl(2), attributes(5)
77
78
79
80SunOS 5.11 10 Dec 2001 acltomode(3SEC)