1ACL_EXTENDED_FILE(3) BSD Library Functions Manual ACL_EXTENDED_FILE(3)
2
4 acl_extended_file, acl_extended_file_nofollow — test for information in
5 ACLs by file name
6
8 Linux Access Control Lists library (libacl, -lacl).
9
11 #include <sys/types.h>
12 #include <acl/libacl.h>
13
14 int
15 acl_extended_file(const char *path_p);
16
17 int
18 acl_extended_file_nofollow(const char *path_p);
19
21 The acl_extended_file() function returns 1 if the file or directory re‐
22 ferred to by the argument path_p is associated with an extended access
23 ACL, or if the directory referred to by path_p is associated with a de‐
24 fault ACL. The function returns 0 if the file has neither an extended ac‐
25 cess ACL nor a default ACL.
26
27 An extended ACL is an ACL that contains entries other than the three re‐
28 quired entries of tag types ACL_USER_OBJ, ACL_GROUP_OBJ and ACL_OTHER.
29 If the result of the acl_extended_file() function for a file object is 0,
30 then ACLs define no discretionary access rights other than those already
31 defined by the traditional file permission bits.
32
33 Access to the file object may be further restricted by other mechanisms,
34 such as Mandatory Access Control schemes. The access(2) system call can
35 be used to check whether a given type of access to a file object would be
36 granted.
37
38 acl_extended_file_nofollow() is identical to acl_extended_file(), except
39 in the case of a symbolic link, where the link itself is interrogated,
40 not the file that it refers to. Since symbolic links have no ACL them‐
41 selves, the operation is supposed to fail on them.
42
44 If successful, the acl_extended_file() function returns 1 if the file ob‐
45 ject referred to by path_p has an extended access ACL or a default ACL,
46 and 0 if the file object referred to by path_p has neither an extended
47 access ACL nor a default ACL. Otherwise, the value -1 is returned and the
48 global variable errno is set to indicate the error.
49
51 If any of the following conditions occur, the acl_extended_file() func‐
52 tion returns -1 and sets errno to the corresponding value:
53
54 [EACCES] Search permission is denied for a component of the
55 path prefix.
56
57 [ENAMETOOLONG] The length of the argument path_p is too long.
58
59 [ENOENT] The named object does not exist or the argument path_p
60 points to an empty string.
61
62 [ENOTDIR] A component of the path prefix is not a directory.
63
64 [ENOTSUP] The file system on which the file identified by path_p
65 is located does not support ACLs, or ACLs are dis‐
66 abled.
67
69 This is a non-portable, Linux specific extension to the ACL manipulation
70 functions defined in IEEE Std 1003.1e draft 17 (“POSIX.1e”, abandoned).
71
73 access(2), acl_get_file(3), acl(5)
74
76 Written by Andreas Gruenbacher <andreas.gruenbacher@gmail.com>.
77
78Linux ACL March 23, 2002 Linux ACL