resetting manifest requested domain to floor
[platform/upstream/acl.git] / man / man3 / acl_check.3
1 .\" Access Control Lists manual pages
2 .\"
3 .\" (C) 2002 Andreas Gruenbacher, <a.gruenbacher@bestbits.at>
4 .\"
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
9 .\"
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
14 .\"
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 .\" GNU General Public License for more details.
19 .\"
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual.  If not, see
22 .\" <http://www.gnu.org/licenses/>.
23 .\"
24 .Dd March 23, 2002
25 .Dt ACL_CHECK 3
26 .Os "Linux ACL"
27 .Sh NAME
28 .Nm acl_check
29 .Nd check an ACL for validity
30 .Sh LIBRARY
31 Linux Access Control Lists library (libacl, \-lacl).
32 .Sh SYNOPSIS
33 .In sys/types.h
34 .In acl/libacl.h
35 .Ft int
36 .Fn acl_check "acl_t acl" "int *last"
37 .Sh DESCRIPTION
38 The
39 .Fn acl_check
40 function checks the ACL referred to by the argument
41 .Va acl
42 for validity.
43 .Pp
44 The three required entries ACL_USER_OBJ, ACL_GROUP_OBJ, and ACL_OTHER
45 must exist exactly once in the ACL. If the ACL contains any ACL_USER or
46 ACL_GROUP entries, then an ACL_MASK entry is also required. The ACL
47 may contain at most one ACL_MASK entry.
48 .Pp
49 The user identifiers must be unique among all entries of type ACL_USER.
50 The group identifiers must be unique among all entries of type ACL_GROUP.
51 .Pp
52 If the ACL referred to by
53 .Va acl
54 is invalid,
55 .Fn acl_check
56 returns a positive error code that indicates which type of error was detected.
57 The following symbolic error codes are defined:
58 .Bl -tag -width ACL_DUPLICATE_ERROR.
59 .It ACL_MULTI_ERROR
60 The ACL contains multiple entries that have a tag type
61 that may occur at most once.
62 .It ACL_DUPLICATE_ERROR
63 The ACL contains multiple ACL_USER entries with the same user ID, or
64 multiple ACL_GROUP entries with the same group ID.
65 .It ACL_MISS_ERROR
66 A required entry is missing.
67 .It ACL_ENTRY_ERROR
68 The ACL contains an invalid entry tag type.
69 .El
70 .Pp
71 The
72 .Fn acl_error
73 function can be used to translate error codes to text messages.
74 .Pp
75 In addition, if the pointer
76 .Va last
77 is not
78 .Li NULL ,
79 .Fn acl_check
80 assigns the number of the ACL entry at which the error was detected to
81 the value pointed to by
82 .Va last .
83 Entries are numbered starting with zero, in the order in which they would be
84 returned by the
85 .Fn acl_get_entry
86 function.
87 .Sh RETURN VALUE
88 If successful, the
89 .Fn acl_check
90 function returns
91 .Li 0
92 if the ACL referred to by
93 .Va acl
94 is valid, and a positive error code if the ACL is invalid. Otherwise, a
95 value of
96 .Li -1
97 is returned and the global variable
98 .Va errno
99 is set to indicate the error.
100 .Sh ERRORS
101 If any of the following conditions occur, the
102 .Fn acl_check
103 function returns
104 .Li -1
105 and sets
106 .Va errno
107 to the corresponding value:
108 .Bl -tag -width Er
109 .It Bq Er EINVAL
110 The argument
111 .Va acl
112 is not a valid pointer to an ACL.
113 .El
114 .Sh STANDARDS
115 This is a non-portable, Linux specific extension to the ACL manipulation
116 functions defined in IEEE Std 1003.1e draft 17 (\(lqPOSIX.1e\(rq, abandoned).
117 .Sh SEE ALSO
118 .Xr acl_valid 3 ,
119 .Xr acl 5
120 .Sh AUTHOR
121 Written by
122 .An "Andreas Gruenbacher" Aq a.gruenbacher@bestbits.at .