1 .\" Copyright (c) 1983, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)initgroups.3 8.1 (Berkeley) 6/4/93
33 .\" $FreeBSD: src/lib/libc/gen/initgroups.3,v 1.10 2001/10/01 16:08:51 ru Exp $
35 .\" @APPLE_LICENSE_HEADER_START@
37 .\" Portions Copyright (c) 2003-2013 Apple Inc. All Rights Reserved.
39 .\" This file contains Original Code and/or Modifications of Original Code
40 .\" as defined in and that are subject to the Apple Public Source License
41 .\" Version 2.0 (the 'License'). You may not use this file except in
42 .\" compliance with the License. Please obtain a copy of the License at
43 .\" http://www.opensource.apple.com/apsl/ and read it before using this
46 .\" The Original Code and all software distributed under the License are
47 .\" distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
48 .\" EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
49 .\" INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
50 .\" FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
51 .\" Please see the License for the specific language governing rights and
52 .\" limitations under the License.
54 .\" @APPLE_LICENSE_HEADER_END@
61 .Nd initialize group access list
63 Standard system libraries.
67 .Fn initgroups "const char *name" "int basegid"
71 function calculates a group access list for the user
74 This group list is then saved in the kernel credentials for the current process.
77 is included in the groups list.
78 Typically this value is given as
79 the default group associated with the user's account record.
81 This function sets at most 16 group IDs in the process credentials.
82 This list can be retrieved using the
85 Note that OS X supports group membership in an unlimited number of groups.
86 The OS X kernel uses the group list stored in the process credentials only
88 Additional group memberships are determined by communication between the operating system and the
92 Processes should not use the group ID numbers from
94 to determine a user's group membership.
95 The list obtained from
97 may only be a partial list of a user's group membership.
98 Membership checks should use the
99 .Xr mbr_gid_to_uuid 3 ,
100 .Xr mbr_uid_to_uuid 3 ,
102 .Xr mbr_check_membership 3
108 returns 0 on success.
109 On failure, this function will return -1 and set
111 to one of the following values:
112 .Bl -tag -width ".Bq Er EFAULT"
114 The caller's effictive UID is not zero.
116 Internal error, an invalid array size was supplied to the kernel.
118 Internal error, invalid data was supplied to the kernel.
123 .Xr mbr_gid_to_uuid 3 ,
124 .Xr mbr_uid_to_uuid 3 ,
125 .Xr mbr_check_membership 3 .