From fenner@parc.xerox.com Tue Jun 13 14:28:48 1995 Received: from alpha.xerox.com (alpha.Xerox.COM [13.1.64.93]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id OAA16579 for ; Tue, 13 Jun 1995 14:28:48 -0700 Received: from baobab.parc.xerox.com ([13.2.116.113]) by alpha.xerox.com with SMTP id <14551(3)>; Tue, 13 Jun 1995 14:27:58 PDT Received: (from fenner@localhost) by baobab.parc.xerox.com (8.6.11/8.6.9) id OAA08396; Tue, 13 Jun 1995 14:31:46 -0700 Message-Id: <199506132131.OAA08396@baobab.parc.xerox.com> Date: Tue, 13 Jun 1995 14:31:46 PDT From: Bill Fenner Reply-To: fenner@parc.xerox.com To: FreeBSD-gnats-submit@freebsd.org Subject: getnetgrent() prints un-helpful error message (with NULL pointer, even) X-Send-Pr-Version: 3.2 >Number: 508 >Category: bin >Synopsis: getnetgrent() prints un-helpful error message (with NULL pointer, even) >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jun 13 14:30:01 1995 >Closed-Date: Mon Aug 14 16:58:21 PDT 1995 >Last-Modified: Mon Aug 14 17:03:44 PDT 1995 >Originator: Bill Fenner >Release: FreeBSD 2.0-BUILT-19950527 i386 >Organization: Xerox PARC >Environment: FreeBSD 2.0.5-ALPHA >Description: /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. >How-To-Repeat: Create a netgroup with an entry like (foo,-BAR) and try to use getnetgrent() on it. >Fix: Probably just need a more intelligent error message. >Release-Note: >Audit-Trail: State-Changed-From-To: open->closed State-Changed-By: wpaul State-Changed-When: Mon Aug 14 16:58:21 PDT 1995 State-Changed-Why: 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. >Unformatted: