freebsd-skq/lib
wpaul c3bd02d791 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
..
csu/i386 Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
libc Fixes for PR #508 and #509 ('botched 'Bad netgroup' error message' and 1995-06-23 14:47:54 +00:00
libcom_err Don't call _doprnt, which doesn't exist; use vfprintf. 1995-01-23 22:53:12 +00:00
libcompat Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
libcrypt Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
libcurses Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
libdisk Merge RELENG_2_0_5 into HEAD 1995-06-11 19:33:05 +00:00
libedit Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
libf2c Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
libF77 Library for f2c (part 2 of 2) 1994-10-26 18:17:41 +00:00
libforms Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
libftp Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
libI77 Library for f2c. (part 1 of 2) 1994-10-26 18:15:35 +00:00
libkvm Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
libm Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
libmd Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
libmytinfo Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
libncurses Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
libpam/modules Remove trailing whitespace. 1995-05-30 06:41:30 +00:00
libpcap Fix handling NULL-encapsulated interfaces (lo & tun) 1995-06-22 16:56:00 +00:00
libresolv BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
librpc Make up for the fact that rpc headers are now installed from include. 1994-08-05 01:59:40 +00:00
librpcsvc If we are going to set the OBJS target, don't add to the old target. This 1995-03-04 17:39:24 +00:00
libscsi Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
libskey Merge RELENG_2_0_5 into HEAD 1995-06-11 19:33:05 +00:00
libss Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
libtelnet Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
libterm Correct the man page extent. 1994-08-08 19:26:23 +00:00
libtermcap Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
libutil Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
liby BSD 4.4 Lite Lib Sources 1994-05-27 05:00:24 +00:00
msun Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
ncurses/ncurses Bump major number instead of minor 1995-05-08 16:08:49 +00:00
rpcsvc Makefile to build librpcsvc. (All sources automatically generated.) 1994-08-07 23:21:08 +00:00
Makefile Add libftp to list of targets. 1995-04-25 15:08:52 +00:00
Makefile.inc From 1.1.5: define default shared library versions. For 2.0, use version 1994-08-04 22:44:00 +00:00