Bug 508 - getnetgrent() prints un-helpful error message (with NULL pointer, even)
Summary: getnetgrent() prints un-helpful error message (with NULL pointer, even)
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1995-06-13 14:30 UTC by fenner
Modified: 1995-08-15 01:03 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fenner 1995-06-13 14:30:01 UTC
	
	/etc/netgroup has a single "+"

	/etc/hosts.equiv has "+@sun-access"

	The NIS netgroup sun-access is a very deeply recursive list.
Example:

% ypmatch sun-access netgroup
sun-accessN         sun-accessD
% ypmatch sun-accessN netgroup
sun-access01N         sun-access02N         sun-access03N
% ypmatch sun-access03N netgroup
parc-pcsN       parc-guestsN    parc-termportsN
% ypmatch parc-pcsN netgroup
pcs01N  pcs02N  pcs03N  pcs04N  pcs05N  pcs06N
% ypmatch pcs02N netgroup
parc-pcs10N         parc-pcs11N         parc-pcs12N         parc-pcs13N         parc-pcs14N         parc-pcs15N         parc-pcs16N         parc-pcs17N         parc-pcs18N
% ypmatch parc-pcs15N netgroup
(esca,-,PARC)   (tech-1,-,PARC)         (doc-control,-,PARC)    (the-stooges,-,PARC)    (munira,-,PARC)         (sonoma,-,PARC)         (tfs-pc,-,PARC)        (oemd-pc,-PARC)  (fourier,-,PARC)


	Attempting to rlogin gives:

crevenia% rlogin baobab
ad netgroup parc-pcs15N at ..(null)

	I assume that this is the error printed by lib/libc/gen/getnetgrent.c:
	parse_netgrp().

	Now, indeed, oemd-pc's entry is bad, but the error message doesn't
	exactly make that very obvious...

	Also, someone ate the first character of the error message.

Fix: 

Probably just need a more intelligent error message.
How-To-Repeat: 
	
	Create a netgroup with an entry like (foo,-BAR) and try to use
	getnetgrent() on it.
Comment 1 Bill Paul freebsd_committer freebsd_triage 1995-08-15 00:58:21 UTC
State Changed
From-To: open->closed

Fixed in revision 1.10 of getnetgrent.c. The message has been 
cleaned up and hidden under an #ifdef DEBUG since it isn't 
terribly helpful even when it's formatted correctly. Also, 
the code now continues to process the rest of the netgroup 
rather than trashing the whole netgroup because of one 
bad member entry.