diff options
author | wpaul <wpaul@FreeBSD.org> | 1996-04-16 00:22:41 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1996-04-16 00:22:41 +0000 |
commit | 24c5b47bb2eed224622ae01565ad620fa1506a5f (patch) | |
tree | 0c2267e23f54e2b60fd4f9cd265010794017f7cb /lib/libc/gen/getnetgrent.c | |
parent | 3ad2f69a9f86d650939c1e04a98ee4f59675af43 (diff) | |
download | FreeBSD-src-24c5b47bb2eed224622ae01565ad620fa1506a5f.zip FreeBSD-src-24c5b47bb2eed224622ae01565ad620fa1506a5f.tar.gz |
NIS cleanups and fixes, the next generation.
getnetgrent.c:
- Catch one bogon that snuck by: in _listmatch(), check for '\0'
rather than '\n'; strings returned from yp_match() are terminated
with a nul, not a newline.
getpwent.c:
- Rip out all of the +inclusion/-exclusion stuff from before and
replace it with something a little less grotty. The main problem
with the old mechanism was that it wasted many cycles processing
NIS entries even after it already knew they were to be exlcuded
(or not included, depending on your pointof view). The highlights
of these changes include:
o Uses an in-memory hash database table to keep track of all the
-@netgroup, -user, and -@group exclusions.
o Tries harder to duplicate the behavior normally obtained when using
NIS inclusions/exclusions on a flat /etc/passwd file (meaning things
come out in much the same order).
o Uses seperate methods for handling getpwent() and getpwnam()/getpwuid()
operations instead of trying to do everything with one general
function, which didn't work as well as I thought it would.
o Uses both getnetgrent() and innetgr() to try to save time where
possible.
o Use only one special token in the local password database
(_PW_KEYYPBYNUM) instead of seperate tokens to mark + and -
entries (and stop using the counter tokens too). If this new
token doesn't exist, the code will make due with the standard
_PW_KEYBYNUM token in order to support older databases that
won't have the new token in them.
All this is an attempt to make this stuff work better in environments
with large NIS passwd databases.
Diffstat (limited to 'lib/libc/gen/getnetgrent.c')
-rw-r--r-- | lib/libc/gen/getnetgrent.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/gen/getnetgrent.c b/lib/libc/gen/getnetgrent.c index a15252d..67375b0 100644 --- a/lib/libc/gen/getnetgrent.c +++ b/lib/libc/gen/getnetgrent.c @@ -283,7 +283,7 @@ int len; if ((ptr = strstr(list, group)) == NULL) return(0); - if (*(ptr + strlen(group)) == ',' || *(ptr + strlen(group)) == '\n') + if (*(ptr + strlen(group)) == ',' || *(ptr + strlen(group)) == '\0') return(1); return(0); |