freebsd-nq/lib/libc/gen
Bill Paul dbf973c0c7 Fixes for PR #508 and #509 ('botched 'Bad netgroup' error message' and
'cycle in netgroup check too greedy').

PR #508 is apparently due to an inconsistency in the way the 4.4BSD
netgroup code deals with bad netgroups. When 4.4BSD code encounters
a badly formed netgroup entry (e.g. (somehost,-somedomain), which,
because of the missing comma between the '-' and 'somedomain,' has
only 2 fields instead of 3), it generates an error message and
then bails out without doing any more processing on the netgroup
containing the bad entry. Conversely, every other *NIX in the world
that usees netgroups just tries to parse the entry as best it can
and then silently continues on its way.

The result is that two bad things happen: 1) we ignore other valid entries
within the netgroup containing the bogus entry, which prevents
us from interoperating with other systems that don't behave this way,
and 2) by printing an error to stderr from inside libc, we hose certain
programs, in this case rlogind. In the problem report, Bill Fenner
noted that the 'B' from 'Bad' was missing, and that rlogind exited
immediately after generating the error. The missing 'B' is apparently
not caused by any problem in getnetgrent.c; more likely it's getting
swallowed up by rlogind somehow, and the error message itself causes
rlogind to become confused. I was able to duplicate this problem and
discovered that running a simple test program on my FreeBSD system
resulted in a properly formatted (if confusing) error, whereas triggering
the error by trying to rlogin to the machine yielded the missing 'B'
problem.

Anyway, the fixes for this are as follows:

- The error message has been reformatted so that it prints out more useful
  information (e.g. Bad entry (somehost,-somedomain) in netgroup "foo").
  We check for NULL entries so that we don't print '(null)' anymore too. :)

- Rearranged things in parse_netgrp()  so that we make a best guess at
  what bad entries are supposed to look like and then continue processing
  instead of bailing out.

- Even though the error message has been cleaned up, it's wrapped inside
  a #ifdef DEBUG. This way we match the behavior of other systems. Since we
  now handle the error condition better anyway, this error message becomes
  less important.

PR #507 is another case of inconsistency. The code that handles
duplicate/circular netgroup entries isn't really 'too greedy; -- it's
just too noisy. If you have a netgroup containing duplicate entries,
the code actually does the right thing, but it also generates an error
message. As with the 'Bad netgroup' message, spewing this out from
inside libc can also hose certain programs (like rlogind). Again, no
other system generates an error message in this case.

The only change here is to hide the error message inside an #ifdef DEBUG.
Like the other message, it's largely superfluous since the code handles
the condition correctly.

Note that PR #510 (+@netgroup host matching in /etc/hosts.equiv) is still
being investigated. I haven't been able to duplicate it myself, and I
strongly suspect it to be a configuration problem of some kind. However,
I'm leaving all three PRs open until I get 510 resolved just for the
sake of paranoia.
1995-06-23 14:47:54 +00:00
..
__xuname.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
_rand48.c Added *ran48 functions, and put them in the correct place this time. 1994-09-23 00:37:55 +00:00
alarm.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
alarm.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
assert.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
clock.3 Change CLK_TCK to CLOCKS_PER_SEC. 1995-02-03 22:09:56 +00:00
clock.c Change CLK_TCK to CLOCKS_PER_SEC. (CLK_TCK is a deprecated POSIX feature 1995-02-03 21:59:45 +00:00
closedir.c Don't cast void functions to void. 1995-06-20 18:31:16 +00:00
config_open.3 Added routines to read the canonical UNIX configuration file. This will 1994-11-13 20:47:44 +00:00
config.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
confstr.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
confstr.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
crypt.3 document libcrypt and libcipher. 1994-09-08 19:46:57 +00:00
crypt.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
ctermid.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
ctermid.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
ctime.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
ctime.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
daemon.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
daemon.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
devname.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
devname.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
difftime.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
directory.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
disklabel.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
drand48.c Added *ran48 functions, and put them in the correct place this time. 1994-09-23 00:37:55 +00:00
erand48.c Added *ran48 functions, and put them in the correct place this time. 1994-09-23 00:37:55 +00:00
err.3 Add err_set_file() and err_set_exit() functions to make it possible for 1995-04-13 18:04:11 +00:00
err.c Add err_set_file() and err_set_exit() functions to make it possible for 1995-04-13 18:04:11 +00:00
errlst.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
exec.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
exec.c Fix execl[e]. Multiple execle's failed because of bogus caching of the 1994-12-12 01:15:01 +00:00
fnmatch.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
fnmatch.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
frexp.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
fstab.c Change strtok() to strsep(), using strtok() can cause memory corruption 1995-03-24 16:33:44 +00:00
ftok.3 Added function and man page for ftok(3), used in conjunction with 1995-05-01 08:53:21 +00:00
ftok.c Added function and man page for ftok(3), used in conjunction with 1995-05-01 08:53:21 +00:00
fts-compat.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
fts-compat.h BSD 4.4 Lite Include Sources 1994-05-24 09:57:34 +00:00
fts.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
fts.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
getbootfile.3 Added getbootfile(3), for an easy C interface to the kern.bootfile MIB 1994-09-23 20:22:01 +00:00
getbootfile.c If sysctl() fails, return "/kernel" so as not to screw people who haven't 1994-09-24 00:10:13 +00:00
getbsize.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getbsize.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getcap.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getcap.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
getcwd.3 stdio.h --> unistd.h 1995-03-09 17:45:23 +00:00
getcwd.c Don't cast void functions to void. 1995-06-20 18:31:16 +00:00
getdiskbyname.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getdomainname.3 Add missing getdomainname manual page. 1994-12-18 14:06:39 +00:00
getdomainname.c Added YP domain name getting/setting support, for SunOS/old program 1994-08-08 00:40:24 +00:00
getfsent.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getgrent.3 Document YP support. 1994-09-20 22:02:20 +00:00
getgrent.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
getgrouplist.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getgrouplist.c Bruce pointed out, that a misleading warning would be issued 1995-02-17 19:45:21 +00:00
gethostname.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
gethostname.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getloadavg.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getloadavg.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getlogin.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getmntinfo.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getmntinfo.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getnetgrent.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getnetgrent.c Fixes for PR #508 and #509 ('botched 'Bad netgroup' error message' and 1995-06-23 14:47:54 +00:00
getosreldate.c Oops, forgot to cvs add this file. 1994-08-10 06:27:35 +00:00
getpagesize.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getpagesize.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getpass.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getpass.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getpwent.3 Document YP support. 1994-09-20 22:02:20 +00:00
getpwent.c Make _havemaster() use yp_first() (again) instead of yp_order() to 1995-06-17 04:00:02 +00:00
getttyent.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getttyent.c Don't cast void functions to void. 1995-06-20 18:31:16 +00:00
getusershell.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
getusershell.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
getvfsent.3 Document getvfsent() and kin. 1994-09-25 01:38:30 +00:00
getvfsent.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
glob.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
glob.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
initgroups.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
initgroups.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
isatty.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
isinf.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
jrand48.c Added *ran48 functions, and put them in the correct place this time. 1994-09-23 00:37:55 +00:00
lcong48.c Added *ran48 functions, and put them in the correct place this time. 1994-09-23 00:37:55 +00:00
ldexp.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
lrand48.c Added *ran48 functions, and put them in the correct place this time. 1994-09-23 00:37:55 +00:00
Makefile.inc Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
modf.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
mrand48.c Added *ran48 functions, and put them in the correct place this time. 1994-09-23 00:37:55 +00:00
msgctl.c Added SYSV ipc system calls. 1994-09-13 14:52:45 +00:00
msgget.c Added SYSV ipc system calls. 1994-09-13 14:52:45 +00:00
msgrcv.c Added SYSV ipc system calls. 1994-09-13 14:52:45 +00:00
msgsnd.c Added SYSV ipc system calls. 1994-09-13 14:52:45 +00:00
nice.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
nice.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
nlist.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
nlist.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
nrand48.c Added *ran48 functions, and put them in the correct place this time. 1994-09-23 00:37:55 +00:00
ntp_gettime.c Function in this module bloodly called 'gethostname' and linked 1994-09-19 22:04:28 +00:00
opendir.c Fix bugs in opendir(): 1995-04-21 15:23:27 +00:00
pause.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
pause.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
popen.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
popen.c Don't cast void functions to void. 1995-06-20 18:31:16 +00:00
psignal.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
psignal.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
pw_scan.c Remove trailing whitespace. 1995-05-30 03:57:47 +00:00
pw_scan.h BSD 4.4 Lite usr.sbin Sources 1994-05-26 05:23:31 +00:00
pwcache.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
pwcache.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
raise.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
raise.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
rand48.3 Fix the bug reported by Torbjorn Granlund <tege@cygnus.com>: 1994-12-25 15:33:39 +00:00
rand48.h Added *ran48 functions, and put them in the correct place this time. 1994-09-23 00:37:55 +00:00
readdir.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
rewinddir.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
scandir.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
scandir.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
seed48.c Added *ran48 functions, and put them in the correct place this time. 1994-09-23 00:37:55 +00:00
seekdir.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
semconfig.c Added SYSV ipc system calls. 1994-09-13 14:52:45 +00:00
semctl.c Added SYSV ipc system calls. 1994-09-13 14:52:45 +00:00
semget.c Added SYSV ipc system calls. 1994-09-13 14:52:45 +00:00
semop.c Added SYSV ipc system calls. 1994-09-13 14:52:45 +00:00
setdomainname.c Added YP domain name getting/setting support, for SunOS/old program 1994-08-08 00:40:24 +00:00
setflags.c Added $Id$ 1994-09-24 02:59:15 +00:00
setflagsbyname.c Added $Id$ 1994-09-24 02:59:15 +00:00
sethostname.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
setjmp.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
setjmperr.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
setmode.3 Add missing header reference 1995-04-09 04:59:40 +00:00
setmode.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
shmat.c Added SYSV ipc system calls. 1994-09-13 14:52:45 +00:00
shmctl.c Added SYSV ipc system calls. 1994-09-13 14:52:45 +00:00
shmdt.c Added SYSV ipc system calls. 1994-09-13 14:52:45 +00:00
shmget.c Added SYSV ipc system calls. 1994-09-13 14:52:45 +00:00
siginterrupt.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
siginterrupt.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
siglist.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
signal.3 Explain the full story, and make it understandable too. 1995-02-25 04:43:20 +00:00
signal.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
sigsetjmp.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
sigsetops.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
sigsetops.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
sleep.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
sleep.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
srand48.c Added *ran48 functions, and put them in the correct place this time. 1994-09-23 00:37:55 +00:00
strtofflags.c Added $Id$ 1994-09-24 02:59:15 +00:00
sysconf.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
sysconf.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
sysctl.3 Remove CPU_COLORDISP, GIO_COLOR now exists 1994-10-18 03:42:18 +00:00
sysctl.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
syslog.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
syslog.c Fix bracket error for LogMask 1995-05-02 17:46:30 +00:00
tcgetpgrp.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
tcsendbreak.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
tcsetattr.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
tcsetpgrp.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
telldir.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
termios.c Clear IGNPAR in cfmakeraw() instead of set it. 1995-03-29 19:28:35 +00:00
time.3 Add missing #include <time.h> with time() prototype 1995-02-24 01:02:59 +00:00
time.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
times.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
times.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
timezone.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
timezone.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
ttyname.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
ttyname.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
ttyslot.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
tzset.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
ualarm.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
ualarm.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
uname.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
uname.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
unvis.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
unvis.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
usleep.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
usleep.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
utime.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
utime.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
valloc.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
valloc.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
vis.3 BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
vis.c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
wait3.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
wait.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
waitpid.c BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00