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

NAME

4     acl_check — check an ACL for validity
5

LIBRARY

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

SYNOPSIS

10     #include <sys/types.h>
11     #include <acl/libacl.h>
12
13     int
14     acl_check(acl_t acl, int *last);
15

DESCRIPTION

17     The acl_check() function checks the ACL referred to by the argument acl
18     for validity.
19
20     The three required entries ACL_USER_OBJ, ACL_GROUP_OBJ, and ACL_OTHER
21     must exist exactly once in the ACL. If the ACL contains any ACL_USER or
22     ACL_GROUP entries, then an ACL_MASK entry is also required. The ACL may
23     contain at most one ACL_MASK entry.
24
25     The user identifiers must be unique among all entries of type ACL_USER.
26     The group identifiers must be unique among all entries of type ACL_GROUP.
27
28     If the ACL referred to by acl is invalid, acl_check() returns a positive
29     error code that indicates which type of error was detected.  The follow‐
30     ing symbolic error codes are defined:
31
32     ACL_MULTI_ERROR       The ACL contains multiple entries that have a tag
33                           type that may occur at most once.
34
35     ACL_DUPLICATE_ERROR   The ACL contains multiple ACL_USER entries with the
36                           same user ID, or multiple ACL_GROUP entries with
37                           the same group ID.
38
39     ACL_MISS_ERROR        A required entry is missing.
40
41     ACL_ENTRY_ERROR       The ACL contains an invalid entry tag type.
42
43     The acl_error() function can be used to translate error codes to text
44     messages.
45
46     In addition, if the pointer last is not NULL, acl_check() assigns the
47     number of the ACL entry at which the error was detected to the value
48     pointed to by last.  Entries are numbered starting with zero, in the
49     order in which they would be returned by the acl_get_entry() function.
50

RETURN VALUE

52     If successful, the acl_check() function returns 0 if the ACL referred to
53     by acl is valid, and a positive error code if the ACL is invalid. Other‐
54     wise, a value of -1 is returned and the global variable errno is set to
55     indicate the error.
56

ERRORS

58     If any of the following conditions occur, the acl_check() function
59     returns -1 and sets errno to the corresponding value:
60
61     [EINVAL]           The argument acl is not a valid pointer to an ACL.
62

STANDARDS

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

SEE ALSO

68     acl_valid(3), acl(5)
69

AUTHOR

71     Written by Andreas Gruenbacher <a.gruenbacher@bestbits.at>.
72
73Linux ACL                       March 23, 2002                       Linux ACL
Impressum