summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/initgroups.c
Commit message (Collapse)AuthorAgeFilesLines
* In preparation for raising NGROUPS and NGROUPS_MAX, change basebrooks2009-06-191-6/+15
| | | | | | | | | | | | | | | | | | | | | | system callers of getgroups(), getgrouplist(), and setgroups() to allocate buffers dynamically. Specifically, allocate a buffer of size sysconf(_SC_NGROUPS_MAX)+1 (+2 in a few cases to allow for overflow). This (or similar gymnastics) is required for the code to actually follow the POSIX.1-2008 specification where {NGROUPS_MAX} may differ at runtime and where getgroups may return {NGROUPS_MAX}+1 results on systems like FreeBSD which include the primary group. In id(1), don't pointlessly add the primary group to the list of all groups, it is always the first result from getgroups(). In principle the old code was more portable, but this was only done in one of the two places where getgroups() was called to the overall effect was pointless. Document the actual POSIX requirements in the getgroups(2) and setgroups(2) manpages. We do not yet support a dynamic NGROUPS, but we may in the future. MFC after: 2 weeks
* Per Regents of the University of Calfornia letter, remove advertisingimp2007-01-091-4/+0
| | | | | | clause. # If I've done so improperly on a file, please let me know.
* Fix problem where initgroups would silently truncate groups withdds2003-11-191-2/+7
| | | | | | | more than NGROUP elements without providing the opportunity to setgroups to fail and correctly return error and set errno. MFC after: 2 weeks
* Fix SCM ID's.obrien2002-02-011-3/+2
|
* Use the proper type (gid_t) for (group)->gr_gid to be orthogonalmarkm2002-01-221-6/+4
| | | | | | with uid_t usage and (user)->pw_uid. PR: 3242
* Do not write warning messages on stderr - a caller is expected to checktobez2001-11-281-8/+2
| | | | | | | | | | | | | the return code and errno instead. Those warnings did not do any good for daemonized users of initgroups(3), and confused cvs clients that communicated with non-root cvs pserver. The committed fix differs from the one suggested in the PR, and was submitted by ru. PR: 15421 Approved by: markm Discussed on: -stable, -current at various times
* Fixed namespace pollution related to `warn' in libc (but not in otherbde2001-08-291-1/+8
| | | | | | libraries or for other members of the err() family). This fixes world breakage in bc and rcs/* for NOSHARED worlds.
* General -Wall warning cleanup, part I.jkh1996-07-121-0/+1
| | | | Submitted-By: Kent Vander Velden <graphix@iastate.edu>
* Minor cleanup, mostly unused vars and missing #includes.phk1995-10-221-0/+1
|
* BSD 4.4 Lite Lib Sourcesrgrimes1994-05-271-0/+58
OpenPOWER on IntegriCloud