diff options
| author | Bill Paul <wpaul@FreeBSD.org> | 1995-03-24 20:42:28 +0000 |
|---|---|---|
| committer | Bill Paul <wpaul@FreeBSD.org> | 1995-03-24 20:42:28 +0000 |
| commit | 0ffe27f544b6d8f4074a5d0f5417076d58517973 (patch) | |
| tree | f3f82cf42f41abbfcf39959b14a50bd177c11645 /lib/libc | |
| parent | a29ae2a103aee32b70cdc75e60594ea134fc2360 (diff) | |
Notes
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/gen/getnetgrent.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/libc/gen/getnetgrent.c b/lib/libc/gen/getnetgrent.c index 68e5ebda39b2..1b581cfb23fa 100644 --- a/lib/libc/gen/getnetgrent.c +++ b/lib/libc/gen/getnetgrent.c @@ -96,10 +96,11 @@ void setnetgrent(group) char *group; { - /* Sanity check: no null group names allowed! */ + /* Sanity check */ - if (group == NULL || *group == '\0') + if (group == NULL || !strlen(group)) return; + if (grouphead.gr == (struct netgrp *)0 || strcmp(group, grouphead.grname)) { endnetgrent(); @@ -184,6 +185,11 @@ innetgr(group, host, user, dom) { char *hst, *usr, *dm; + /* Sanity check */ + + if (group == NULL || !strlen(group)) + return (0); + setnetgrent(group); while (getnetgrent(&hst, &usr, &dm)) if ((host == (char *)0 || !strcmp(host, hst)) && |
