Git init
[framework/base/acl.git] / man / man3 / acl_get_perm.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_GET_PERM 3
26 .Os "Linux ACL"
27 .Sh NAME
28 .Nm acl_get_perm
29 .Nd test for a permission in an ACL permission set
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_get_perm "acl_permset_t permset_d" "acl_perm_t perm"
37 .Sh DESCRIPTION
38 The
39 .Fn acl_get_perm
40 function tests if the permission specified by the argument
41 .Va perm
42 is contained in the ACL permission set pointed to by the argument
43 .Va permset_d .
44 .Pp
45 Any existing descriptors that refer to
46 .Va permset_d
47 continue to refer to that permission set.
48 .Sh RETURN VALUE
49 If successful, the
50 .Fn acl_get_perm
51 function returns
52 .Li 1
53 if the permission specified by
54 .Va perm
55 is contained in the ACL permission set
56 .Va permset_d ,
57 and
58 .Li 0
59 if the permission is not contained in the permission set. Otherwise,
60 the value
61 .Li -1
62 is returned and the global variable
63 .Va errno
64 is set to indicate the error.
65 .Sh ERRORS
66 If any of the following conditions occur, the
67 .Fn acl_get_perm
68 function returns
69 .Li -1
70 and sets
71 .Va errno
72 to the corresponding value:
73 .Bl -tag -width Er
74 .It Bq Er EINVAL
75 The argument
76 .Va permset_d
77 is not a valid descriptor for a permission set within an ACL entry.
78 .Pp
79 The argument
80 .Va perm
81 is not a valid
82 .Va acl_perm_t
83 value.
84 .El
85 .Sh STANDARDS
86 This is a non-portable, Linux specific extension to the ACL manipulation
87 functions defined in IEEE Std 1003.1e draft 17 (\(lqPOSIX.1e\(rq, abandoned).
88 .Sh SEE ALSO
89 .Xr acl_add_perm 3 ,
90 .Xr acl_clear_perms 3 ,
91 .Xr acl_delete_perm 3 ,
92 .Xr acl_get_permset 3 ,
93 .Xr acl_set_permset 3 ,
94 .Xr acl 5
95 .Sh AUTHOR
96 Written by
97 .An "Andreas Gruenbacher" Aq a.gruenbacher@bestbits.at .