summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>1996-05-21 16:11:27 +0000
committerBill Paul <wpaul@FreeBSD.org>1996-05-21 16:11:27 +0000
commitdfe8e51c4db533cb35a29342af36ec3b1ffa0b17 (patch)
tree5c13c8cab23e6c790ebacf64533381036cfe5a5b /lib
parentce595c03fb4d7ec9f2957c0357dd357a5a011f77 (diff)
Notes
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/getnetgrent.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/libc/gen/getnetgrent.c b/lib/libc/gen/getnetgrent.c
index 67375b09aa99..9b9d0d98db12 100644
--- a/lib/libc/gen/getnetgrent.c
+++ b/lib/libc/gen/getnetgrent.c
@@ -280,11 +280,13 @@ int len;
{
char *ptr = list;
- if ((ptr = strstr(list, group)) == NULL)
- return(0);
+ while (ptr = strstr(ptr, group)) {
+
+ ptr += strlen(group);
- if (*(ptr + strlen(group)) == ',' || *(ptr + strlen(group)) == '\0')
- return(1);
+ if (*ptr == ',' || *ptr == '\0')
+ return(1);
+ }
return(0);
}
@@ -345,11 +347,9 @@ innetgr(group, host, user, dom)
if(yp_get_default_domain(&_netgr_yp_domain))
return(0);
while(_buildkey(&_key, user ? user : host, dom, &rot)) {
- if (yp_match(_netgr_yp_domain, user? "netgroup.byuser":
+ if (!yp_match(_netgr_yp_domain, user? "netgroup.byuser":
"netgroup.byhost", _key, strlen(_key), &result,
- &resultlen))
- free(result);
- else {
+ &resultlen)) {
rv = _listmatch(result, group, resultlen);
free(result);
if (rv)