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