summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/getgrouplist.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* The "always hint that getpw operation is happening with access() the YPderaadt2019-07-021-1/+7
| | | | | | | lock file" would trash errno, creating confusion. One instance found by richardipsum@fastmail, other two identified from original commit ok millert
* modify getpw*(), getgr*(), and getgrouplist() functions to access thederaadt2015-12-011-1/+8
| | | | | | | | | YP lock file unconditionally. This hints to the kernel that a "getpw" operation is happening, even in the non-YP case. This looks like a gruesome hack, but helps refine the ways these functions are called and mandates the right pledge requests. Once the tree is fully annotated we will know better how to improve the backing store management. ok semarie espie beck
* Wrap <unistd.h> so that internal calls go direct and they're all weak symbolsguenther2015-09-121-1/+2
| | | | Delete unused 'fd' argument from internal function oldttyname()
* Do not assume that asprintf() clears the pointer on failure, whichmillert2015-06-031-3/+3
| | | | | is non-portable. Also add missing asprintf() return value checks. OK deraadt@ guenther@ doug@
* When fopen()ing internal to libc (the API doesn't support the useguenther2014-09-151-2/+2
| | | | | | | of the resulting FILE *), then pass fopen() the 'e' mode letter to mark it close-on-exec. ok miod@
* fix a leak in getgrouplist()jsg2014-01-221-1/+2
| | | | | problem reproduced and fix verified by schwarze who wrote the code ok krw@ deraadt@ schwarze@
* add some prototypes, casts, includes, parenthesis, and whatnot totedu2013-04-171-2/+2
| | | | silence some warnings.
* Fix the handle locking in stdio to use flockfile/funlockfilekurt2009-11-091-2/+2
| | | | | | | | | | | | | internally when and where required. Macros in <stdio.h> are updated to automatically call the underlying functions when the process is threaded to obtain the necessary locking. A private mutex is added to protect __sglue, the internal list of FILE handles, and another to protect the one-time initialization. Some routines in libc that use getc() change to use getc_unlocked() as they're either protected by their own lock or aren't thread-safe routines anyway. committing on behalf of and okay guenther@ now that we have install media space available.
* Back out previous commit, as it caused too much growth for the installguenther2009-10-221-2/+2
| | | | media to fit
* Fix the handle locking in stdio to use flockfile/funlockfileguenther2009-10-211-2/+2
| | | | | | | | | | | | internally when and where required. Macros in <stdio.h> are updated to automatically call the underlying functions when the process is threaded to obtain the necessary locking. A private mutex is added to protect __sglue, the internal list of FILE handles, and another to protect the one-time initialization. Some routines in libc that use getc() change to use getc_unlocked() as they're either protected by their own lock or aren't thread-safe routines anyway. ok kurt@, earlier version tested by sthen@ and jj@
* getgrouplist(3) used to and ought to return 0 on success;schwarze2009-06-231-5/+13
| | | | | fixing a regression introduced in rev. 1.16 spotted by otto@; ok millert@ otto@
* Take advantage of the surprise libc bump to bring inschwarze2009-06-031-4/+8
| | | | | | | | YP group(5) exclusion, i.e. support -groupname:*:: in /etc/group. Such groups will be excluded from later +:*::, in just the same was as it is already done for passwd(5). I have been running this since the autumn of 2008. Discussed with several (including deraadt@, millert@, jmc@).
* getgrouplist: If YP is #defined and enabled in /etc/group(5) and /etc/netid(5)schwarze2009-03-271-57/+119
| | | | | | | | | | | | | | contains a matching entry, use that and refrain from accessing YP. getpwnam/getpwuid: If YP is #defined and /etc/master.passwd(5) contains a matching entry before the first YP entry, use that and stay away from YP. Taken together, this allows a solution to the following problem pointed out by deraadt@: When YP was configured but temporarily unavailable, even root login would block, hindering you when trying to do repairs. To avoid this, you can now provide a static entry for root in /etc/netid. Using suggestions from miod@ otto@ blambert@ jmc@. "commit" deraadt@, "cool" ajacoutot@, "looks fine" jmc@.
* add missing header needed by asprintf().chl2008-08-231-1/+2
| | | | ok otto@ deraadt@
* After spotting a + record, continue scanning and pick up later groupsderaadt2008-08-221-4/+10
| | | | | in the file. Problem spotted by drahn. ok millert
* create a private getpwent()-like interface which does not walk the YPderaadt2008-06-241-9/+81
| | | | | | | groups map but instead tells us that it is there. then use this interface in getgrouplist(), and do a single lookup against netid.byname instead to get all the groups associated with that user ok kurt, testing by many others
* zap remaining rcsid.espie2005-08-081-4/+1
| | | | | | Kill old files that are no longer compiled. okay theo
* deregister (and deauto!). ok millert@ marco@otto2005-03-251-3/+3
|
* ansify function definitions and zap some `register'jfb2004-05-181-6/+2
| | | | ok millert@
* protosderaadt2003-06-251-1/+2
|
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* repair duplication checkderaadt1997-08-191-4/+5
|
* do not reuse id's. also be more careful with maxgids.deraadt1997-08-191-1/+10
|
* Clean up some -Wall complaints.millert1997-07-091-2/+2
|
* Remove dead codetholo1996-09-151-2/+1
| | | | | | Remove unused variables Silence some warnings lint(1) is your friend
* Fix RCS idstholo1996-08-191-7/+1
| | | | Make sure everything uses {SYS,}LIBC_SCCS properly
* Prototype internal functionstholo1996-03-251-2/+2
| | | | Do the right thing in presense of __STDC__
* initial import of NetBSD treederaadt1995-10-181-0/+94