Commit | Line | Data |
---|---|---|
ae59e04c CL |
1 | .\" Copyright (c) 1983, 1991 Regents of the University of California. |
2 | .\" All rights reserved. | |
22e59cfd | 3 | .\" |
ae59e04c | 4 | .\" %sccs.include.redist.man% |
22e59cfd | 5 | .\" |
11b3b4d6 | 6 | .\" @(#)initgroups.3 6.4 (Berkeley) %G% |
ae59e04c CL |
7 | .\" |
8 | .Dd | |
9 | .Dt INITGROUPS 3 | |
10 | .Os BSD 4.2 | |
11 | .Sh NAME | |
12 | .Nm initgroups | |
13 | .Nd initialize group access list | |
14 | .Sh SYNOPSIS | |
15 | .Fd #include <unistd.h> | |
16 | .Ft int | |
17 | .Fn initgroups "const char *name" "int basegid" | |
18 | .Sh DESCRIPTION | |
19 | The | |
20 | .Fn initgroups | |
21 | function | |
11b3b4d6 KM |
22 | uses the |
23 | .Xr getgrouplist 3 | |
24 | function to calculate the group access list for the user | |
22e59cfd | 25 | specified in |
ae59e04c | 26 | .Fa name . |
11b3b4d6 KM |
27 | This group list is then setup for the current process using |
28 | .Xr setgroups 2 . | |
22e59cfd | 29 | The |
ae59e04c | 30 | .Fa basegid |
22e59cfd KM |
31 | is automatically included in the groups list. |
32 | Typically this value is given as | |
33 | the group number from the password file. | |
ae59e04c CL |
34 | .Sh RETURN VALUES |
35 | The | |
36 | .Fn initgroups | |
37 | function | |
22e59cfd | 38 | returns \-1 if it was not invoked by the super-user. |
ae59e04c CL |
39 | .Sh SEE ALSO |
40 | .Xr setgroups 2 , | |
11b3b4d6 | 41 | .Xr getgrouplist 3 |
ae59e04c CL |
42 | .Sh HISTORY |
43 | The | |
44 | .Nm | |
45 | function appeared in | |
46 | .Bx 4.2 . | |
47 | .Sh BUGS | |
48 | The | |
11b3b4d6 KM |
49 | .Fn getgrouplist |
50 | function called by | |
51 | .Nm | |
22e59cfd | 52 | uses the routines based on |
ae59e04c | 53 | .Xr getgrent 3 . |
22e59cfd KM |
54 | If the invoking program uses any of these routines, |
55 | the group structure will | |
56 | be overwritten in the call to | |
ae59e04c | 57 | .Fn initgroups . |