Home | History | Annotate | Download | only in gen
History log of /src/lib/libc/gen/getgrouplist.c
RevisionDateAuthorComments
 1.22  28-Apr-2008  martin branches: 1.22.8;
Remove clause 3 and 4 from TNF licenses
 1.21  06-Jan-2005  lukem branches: 1.21.24;
Implement getgroupmembership(3). This is similar to getgrouplist(3), except
that the "int maxgroups" and "int *ngroups" parameters are separated into
two separate parameters which makes it possible to call multiple nsswitch
back-ends and have the results correctly merged.
getgrouplist(3) is now implemented using getgroupmembership(3).

Proposed on tech-userlevel on December 1, 2004.
 1.20  28-Sep-2004  lukem 'gid_t *groups' may be NULL if we're just sizing the list by calling
getgrouplist(3) with *grpcnt==0, so don't _DIAGASSERT(groups != NULL).

Tweak API used between getgrouplist(3) and the back-end nsswitch methods;
move the public return value to the start of the va_list and reserve the
'void *retval' for "internal use" (e.g, errno passing or some other need).
 1.19  25-Sep-2004  lukem Try nsdispatch "getgrouplist" before iterating the getgrent() list.
Implement a dns (hesiod) backend which tries a grplist hesiod lookup.
Convert back to using getgrent() similar to rev 1.15, instead of
using the private _getgrent_user() from getgrent.c.
 1.18  25-Sep-2004  lukem ANSI KNF
 1.17  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.16  16-Feb-2003  elric Reorganise the getting of grouplists for a user so that Hesiod (and
potentially other name services) can directly query for a user's
grouplist rather than needing to iterate over the group map. This
is required for correct operation of Hesiod.

Reviewed by: lukem, christos
Addresses PR lib/20183
 1.15  22-Jan-2000  mycroft Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.14  20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.13  16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.12  25-Apr-1999  lukem suppress duplicate gids (e.g, when multiple sources are given in
nsswitch.conf and they contain similar information).

XXX: in the case where the given array is too small and -1 is returned,
the returned ngroups will be too large by a factor of the difference
between the given size and the number of matches. this is not considered
to be a major problem, since it's still going to be a smaller figure than
what the previous (non suppressive) behaviour returned.
 1.11  08-Apr-1999  drochner remove unused label
 1.10  05-Apr-1999  mycroft Return the full group count when it exceeds the maximum. Also DTRT if the
maximum is 0 (possibly used to size the list for memory allocation, rather
than core dumping).
 1.9  03-Feb-1998  perry branches: 1.9.2;
remove obsolete register declarations
 1.8  02-Feb-1998  perry merge/update to lite-2
 1.7  21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.6  13-Jul-1997  christos Fix RCSID's
Fix inconsistent function definition with unistd.h
Fix gcc warnings
 1.5  01-Jun-1995  jtc branches: 1.5.4;
Don't duplicate the primary group. The first member of the groups list
no longer serves as effective group id.
 1.4  25-Feb-1995  cgd update to 4.4-Lite where appropriate, clean up Id format, etc.
 1.3  13-Oct-1994  cgd oops; fix that.
 1.2  13-Oct-1994  cgd check bounds properly.
 1.1  05-May-1994  cgd branches: 1.1.1; 1.1.2;
add getgrouplist
 1.1.2.1  15-Oct-1994  cgd From trunk.
 1.1.1.2  02-Feb-1998  perry import lite-2
 1.1.1.1  25-Feb-1995  cgd from lite, with minor name rearrangement to fit.
 1.5.4.1  19-Sep-1996  jtc snapshot namespace cleanup: gen
 1.9.2.1  27-Apr-1999  perry pullup 1.9->1.12 (lukem)
 1.21.24.1  18-May-2008  yamt sync with head.
 1.22.8.2  28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.22.8.1  28-Apr-2008  martin file getgrouplist.c was added on branch christos-time_t on 2008-04-28 20:23:00 +0000

RSS XML Feed