1acl_get(3SEC)        File Access Control Library Functions       acl_get(3SEC)
2
3
4

NAME

6       acl_get,  facl_get, acl_set, facl_set - get or set a file's Access Con‐
7       trol List (ACL)
8

SYNOPSIS

10       cc [ flag... ] file... -lsec [ library... ]
11       #include <sys/acl.h>
12
13       int *acl_get(const char *path, int flag, acl_t **aclp);
14
15
16       int *facl_get(int fd, int flag, acl_t **aclp);
17
18
19       int acl_set(const char *path, acl_t *aclp);
20
21
22       int facl_set(int fd, acl_t *aclp);
23
24

DESCRIPTION

26       The acl_get() and facl_get() functions retrieve an Access Control  List
27       (ACL)  of  a file whose name is given by path or referenced by the open
28       file descriptor fd. The flag argument specifies whether a  trivial  ACL
29       should  be  retrieved.  When  the flag argument is ACL_NO_TRIVIAL, only
30       ACLs that are not trivial will be retrieved. The ACL is returned in the
31       aclp argument.
32
33
34       The acl_set() and facl_set() functions are used for setting an ACL of a
35       file whose name is given  by  path  or  referenced  by  the  open  file
36       descriptor fd. The aclp argument specifies the ACL to set.
37
38
39       The  acl_get()  and acl_set() functions support multiple types of ACLs.
40       When possible, the acl_set() function translates an ACL to  the  target
41       file's  style  of ACL. Currently this is only possible when translating
42       from a POSIX-draft ACL such as on UFS to a file  system  that  supports
43       NFSv4 ACL semantics such as ZFS or NFSv4.
44

RETURN VALUES

46       Upon  successful completion, acl_get() and facl_get() return 0 and aclp
47       is non-NULL. The aclp argument can be NULL after successful  completion
48       if the file had a trivial ACL and the flag argument was ACL_NO_TRIVIAL.
49       Otherwise, -1 is returned and errno is set to indicate the error.
50
51
52       Upon successful completion, acl_set() and facl_set() return  0.  Other‐
53       wise, -1 is returned and errno is set to indicate the error.
54

ERRORS

56       These functions will fail if:
57
58       EACCES     The caller does not have access to a component of path.
59
60
61       EIO        A disk I/O error has occured while retrieving the ACL.
62
63
64       ENOENT     A component of the path does not exist.
65
66
67       ENOSYS     The file system does not support ACLs.
68
69
70       ENOTSUP    The ACL supplied could not be translated to an NFSv4 ACL.
71
72

ATTRIBUTES

74       See attributes(5) for descriptions of the following attributes:
75
76
77
78
79       ┌─────────────────────────────┬─────────────────────────────┐
80       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
81       ├─────────────────────────────┼─────────────────────────────┤
82       │Interface Stability          │Evolving                     │
83       ├─────────────────────────────┼─────────────────────────────┤
84       │MT-Level                     │MT-Safe                      │
85       └─────────────────────────────┴─────────────────────────────┘
86

SEE ALSO

88       chmod(1), acl(2), acl(5), attributes(5)
89
90
91
92SunOS 5.11                        6 Oct 2005                     acl_get(3SEC)
Impressum