resetting manifest requested domain to floor
[platform/upstream/acl.git] / man / man3 / acl_calc_mask.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_CALC_MASK 3
26 .Os "Linux ACL"
27 .Sh NAME
28 .Nm acl_calc_mask
29 .Nd calculate the file group class mask
30 .Sh LIBRARY
31 Linux Access Control Lists library (libacl, \-lacl).
32 .Sh SYNOPSIS
33 .In sys/types.h
34 .In sys/acl.h
35 .Ft int
36 .Fn acl_calc_mask "acl_t *acl_p"
37 .Sh DESCRIPTION
38 The
39 .Fn acl_calc_mask
40 function calculates and sets the permissions associated with the ACL_MASK
41 ACL entry of the ACL referred to by
42 .Va acl_p .
43 The value of the new permissions is the union of the permissions
44 granted by all entries of tag type ACL_GROUP, ACL_GROUP_OBJ, or ACL_USER.
45 If the ACL referred to by
46 .Va acl_p
47 already contains an ACL_MASK entry, its permissions are overwritten;
48 if it does not contain an ACL_MASK entry, one is added.
49 .Pp
50 If the ACL referred to by
51 .Va acl_p
52 does not contain enough space for the new ACL entry, then additional working
53 storage may be allocated. If the working storage cannot be increased in the
54 current location, then it may be relocated and the previous working storage
55 is released and a pointer to the new working storage is returned via
56 .Va acl_p .
57 .Pp
58 The order of existing entries in the ACL is undefined after this function.
59 .Pp
60 Any existing ACL entry descriptors that refer to entries in the ACL continue to
61 refer to those entries. Any existing ACL pointers that refer to the ACL
62 referred to by
63 .Va acl_p
64 continue to refer to the ACL.
65 .\" <AG>
66 .\" Conflict between requirements:
67 .\" (a) ACL may be relocated,
68 .\" (b) all pointers remain valid.
69 .\" </AG>
70 .Sh RETURN VALUE
71 .Rv -std acl_calc_mask
72 .Sh ERRORS
73 If any of the following conditions occur, the
74 .Fn acl_calc_mask
75 function returns
76 .Li -1
77 and sets
78 .Va errno
79 to the corresponding value:
80 .Bl -tag -width Er
81 .It Bq Er EINVAL
82 The argument
83 .Va acl
84 is not a valid pointer to an ACL.
85 .It Bq Er ENOMEM
86 The
87 .Fn acl_calc_mask
88 function is unable to allocate the memory required for an ACL_MASK ACL entry.
89 .El
90 .Sh STANDARDS
91 IEEE Std 1003.1e draft 17 (\(lqPOSIX.1e\(rq, abandoned)
92 .Sh SEE ALSO
93 .Xr acl_check 3 ,
94 .Xr acl_get_entry 3 ,
95 .Xr acl_valid 3 ,
96 .Xr acl 5
97 .Sh AUTHOR
98 Derived from the FreeBSD manual pages written by
99 .An "Robert N M Watson" Aq rwatson@FreeBSD.org ,
100 and adapted for Linux by
101 .An "Andreas Gruenbacher" Aq a.gruenbacher@bestbits.at .