xref: /netbsd-src/lib/libc/posix1e/acl_get_qualifier.3 (revision 1b3734281f17fd86d3db0e29f84ea9985be6fe06)
1.\" $NetBSD: acl_get_qualifier.3,v 1.2 2020/06/18 19:46:34 wiz Exp $
2.\"-
3.\" Copyright (c) 2001 Chris D. Faulhaber
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.\" $FreeBSD: head/lib/libc/posix1e/acl_get_qualifier.3 267774 2014-06-23 08:25:03Z bapt $
28.\"
29.Dd March 13, 2001
30.Dt ACL_GET_QUALIFIER 3
31.Os
32.Sh NAME
33.Nm acl_get_qualifier
34.Nd retrieve the qualifier from an ACL entry
35.Sh LIBRARY
36.Lb libc
37.Sh SYNOPSIS
38.In sys/types.h
39.In sys/acl.h
40.Ft void *
41.Fn acl_get_qualifier "acl_entry_t entry_d"
42.Sh DESCRIPTION
43The
44.Fn acl_get_qualifier
45function
46is a POSIX.1e call that retrieves the qualifier of the tag for
47the ACL entry indicated by the argument
48.Fa entry_d
49into working storage and returns a pointer to that storage.
50.Pp
51If the value of the tag type in the ACL entry referred to by
52.Fa entry_d
53is
54.Dv ACL_USER ,
55then the value returned by
56.Fn acl_get_qualifier
57will be a pointer to type
58.Vt uid_t .
59.Pp
60If the value of the tag type in
61the ACL entry referred to by
62.Fa entry_d
63is
64.Dv ACL_GROUP ,
65then the value returned by
66.Fn acl_get_qualifier
67will be a pointer to type
68.Vt gid_t .
69.Pp
70If the value of the tag type in the ACL entry referred to by
71.Fa entry_d
72is
73.Dv ACL_UNDEFINED_TAG , ACL_USER_OBJ , ACL_GROUP_OBJ ,
74.Dv ACL_OTHER , ACL_MASK ,
75or an implementation-defined value for which a qualifier
76is not supported, then
77.Fn acl_get_qualifier
78will return a value of
79.Vt ( void * ) Ns Dv NULL
80and the function will fail.
81.Pp
82This function may cause memory to be allocated.
83The caller should
84free any releasable memory, when the new qualifier is no longer
85required, by calling
86.Fn acl_free
87with
88.Vt void *
89as the argument.
90.Sh RETURN VALUES
91The
92.Fn acl_get_qualifier
93function returns a pointer to the allocated storage if successful;
94otherwise a
95.Dv NULL
96pointer is returned and the global variable
97.Va errno
98is set to indicate the error.
99.Sh ERRORS
100The
101.Fn acl_get_qualifier
102fails if:
103.Bl -tag -width Er
104.It Bq Er EINVAL
105Argument
106.Fa entry_d
107does not point to a valid descriptor for an ACL entry.
108The
109value of the tag type in the ACL entry referenced by argument
110.Fa entry_d
111is not
112.Dv ACL_USER
113or
114.Dv ACL_GROUP .
115.It Bq Er ENOMEM
116The value to be returned requires more memory than is allowed
117by the hardware or system-imposed memory management constraints.
118.El
119.Sh SEE ALSO
120.Xr acl 3 ,
121.Xr acl_create_entry 3 ,
122.Xr acl_free 3 ,
123.Xr acl_get_entry 3 ,
124.Xr acl_get_tag_type 3 ,
125.Xr acl_set_qualifier 3 ,
126.Xr acl_set_tag_type 3 ,
127.Xr posix1e 3
128.Sh STANDARDS
129POSIX.1e is described in IEEE POSIX.1e draft 17.
130.Sh HISTORY
131POSIX.1e support was introduced in
132.Fx 4.0 .
133The
134.Fn acl_get_qualifier
135function was added in
136.Fx 5.0 .
137.Sh AUTHORS
138The
139.Fn acl_get_qualifier
140function was written by
141.An Chris D. Faulhaber Aq Mt jedgar@fxp.org .
142