[BACK]Return to getgrouplist.3 CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libc / gen

Annotation of src/lib/libc/gen/getgrouplist.3, Revision 1.11

1.11    ! lukem       1: .\"    $NetBSD: getgrouplist.3,v 1.10 2003/08/07 16:42:49 agc Exp $
1.2       cgd         2: .\"
1.1       cgd         3: .\" Copyright (c) 1991, 1993
                      4: .\"    The Regents of the University of California.  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.
1.10      agc        14: .\" 3. Neither the name of the University nor the names of its contributors
1.1       cgd        15: .\"    may be used to endorse or promote products derived from this software
                     16: .\"    without specific prior written permission.
                     17: .\"
                     18: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     19: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     20: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     21: .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     22: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     23: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     24: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     25: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     26: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     27: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     28: .\" SUCH DAMAGE.
                     29: .\"
                     30: .\"     @(#)getgrouplist.3     8.1 (Berkeley) 6/9/93
                     31: .\"
1.11    ! lukem      32: .Dd September 28, 2004
1.1       cgd        33: .Dt GETGROUPLIST 3
                     34: .Os
                     35: .Sh NAME
                     36: .Nm getgrouplist
                     37: .Nd calculate group access list
1.5       perry      38: .Sh LIBRARY
                     39: .Lb libc
1.1       cgd        40: .Sh SYNOPSIS
1.9       wiz        41: .In unistd.h
1.1       cgd        42: .Ft int
1.3       jtc        43: .Fn getgrouplist "const char *name" "gid_t basegid" "gid_t *groups" "int *ngroups"
1.1       cgd        44: .Sh DESCRIPTION
                     45: The
                     46: .Fn getgrouplist
1.6       lukem      47: function reads through the group database and calculates
1.1       cgd        48: the group access list for the user specified in
                     49: .Fa name .
                     50: The
                     51: .Fa basegid
                     52: is automatically included in the groups list.
                     53: Typically this value is given as
1.6       lukem      54: the group number from the password database.
1.1       cgd        55: .Pp
                     56: The resulting group list is returned in the integer array pointed to by
                     57: .Fa groups .
1.7       wiz        58: The caller specifies the size of the
1.1       cgd        59: .Fa groups
                     60: array in the integer pointed to by
                     61: .Fa ngroups ;
                     62: the actual number of groups found is returned in
                     63: .Fa ngroups .
1.6       lukem      64: .Pp
                     65: Duplicate group ids will be suppressed from the result.
1.1       cgd        66: .Sh RETURN VALUES
                     67: The
                     68: .Fn getgrouplist
                     69: function
1.11    ! lukem      70: returns 0 if successful, and
1.1       cgd        71: returns \-1 if the size of the group list is too small to
                     72: hold all the user's groups.
1.11    ! lukem      73: In the latter case, the
        !            74: .Fa groups
        !            75: array will be filled with as many groups as will fit and
        !            76: .Fa ngroups
        !            77: will contain the total number of groups found.
1.1       cgd        78: .Sh FILES
                     79: .Bl -tag -width /etc/group -compact
                     80: .It Pa /etc/group
                     81: group membership list
                     82: .El
                     83: .Sh SEE ALSO
                     84: .Xr setgroups 2 ,
1.11    ! lukem      85: .Xr initgroups 3 ,
        !            86: .Xr group 5 .
1.1       cgd        87: .Sh HISTORY
                     88: The
                     89: .Fn getgrouplist
1.4       perry      90: function first appeared in
                     91: .Bx 4.4 .
1.1       cgd        92: .Sh BUGS
                     93: The
                     94: .Fn getgrouplist
                     95: function
                     96: uses the routines based on
                     97: .Xr getgrent 3 .
                     98: If the invoking program uses any of these routines,
                     99: the group structure will
                    100: be overwritten in the call to
                    101: .Fn getgrouplist .

CVSweb <webmaster@jp.NetBSD.org>