From giles@nemeton.com.au  Sat Jan 11 02:47:22 1997
Received: from perki0.connect.com.au (perki0.connect.com.au [192.189.54.85])
          by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id CAA09839
          for <freebsd-gnats-submit@freebsd.org>; Sat, 11 Jan 1997 02:47:03 -0800 (PST)
Received: (from Unemeton@localhost) by perki0.connect.com.au id VAA29904
  (8.7.6h/IDA-1.6); Sat, 11 Jan 1997 21:46:55 +1100 (EST)
Subject:

>Number:         2447
>Category:       junk
>Synopsis:       
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 11 02:50:00 PST 1997
>Closed-Date:    Sat Jan 11 20:22:49 PST 1997
>Last-Modified:  Tue Nov 27 19:23:36 PST 2001
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: gpalmer 
State-Changed-When: Sat Jan 11 20:22:49 PST 1997 
State-Changed-Why:  
Misfiled PR. Should have been a reply to 1387 
>Unformatted:
 >Received: from nemeton.com.au (localhost.nemeton.com.au [127.0.0.1])
           by nemeton.com.au (8.8.4/8.8.4) with SMTP
 	  id VAA03369; Sat, 11 Jan 1997 21:42:00 +1100 (EST)
 Sender: giles@nemeton.com.au
 Message-ID: <32D76E78.794BDF32@nemeton.com.au>
 Date: Sat, 11 Jan 1997 21:42:00 +1100
 From: Giles Lean <giles@nemeton.com.au>
 Organization: Nemeton Pty. Ltd.
 X-Mailer: Mozilla 3.01 (X11; I; BSD/386 uname failed)
 MIME-Version: 1.0
 To: freebsd-gnats-submit@freebsd.org, brion@queeg.com
 Subject: Re: bin/1387: Group file errors cause absolute havoc
 Content-Type: multipart/mixed; boundary="------------1CFBAE3959E2B60015FB7483"
 
 This is a multi-part message in MIME format.
 
 --------------1CFBAE3959E2B60015FB7483
 Content-Type: text/plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 This problem is due to getpwent() and friends bailing out on
 malformed lines instead of ignoring them.
 
 The following patch to the 2.2 candidate code causes malformed
 lines to be ignored.
 
 For reference the NetBSD code has the same changes made.
 
 A similar problem needs to be fixed in the dynamic buffer code
 in 3.0-current, but the 2.2 release is more urgent.
 
 -- 
 
 Giles Lean             <giles@nemeton.com.au>           +61 3 9480 2118
 Nemeton Pty. Ltd.                                   fax +61 3 9480 1771
 PGP Key fingerprint =  9F FB 28 37 81 F2 AC F3  8A B0 37 E5 73 CF 39 E7
 
 --------------1CFBAE3959E2B60015FB7483
 Content-Type: text/plain; charset=us-ascii; name="diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline; filename="diff"
 
 Index: getgrent.c
 ===================================================================
 RCS file: /a/FreeBSD/CVS/src/lib/libc/gen/getgrent.c,v
 retrieving revision 1.12.2.1
 diff -c -r1.12.2.1 getgrent.c
 *** getgrent.c	1996/12/31 17:42:28	1.12.2.1
 --- getgrent.c	1997/01/11 09:59:20
 ***************
 *** 236,242 ****
   			continue;
   		}
   		if ((_gr_group.gr_name = strsep(&bp, ":\n")) == NULL)
 ! 			break;
   #ifdef YP
   		/*
   		 * XXX   We need to be careful to avoid proceeding
 --- 236,242 ----
   			continue;
   		}
   		if ((_gr_group.gr_name = strsep(&bp, ":\n")) == NULL)
 ! 			continue;
   #ifdef YP
   		/*
   		 * XXX   We need to be careful to avoid proceeding
 ***************
 *** 282,293 ****
   			if (_ypfound)
   				return(1);
   			else
 ! 				break;
   		if (strlen(cp) || !_ypfound)
   			_gr_group.gr_passwd = cp;
   #else
   		if ((_gr_group.gr_passwd = strsep(&bp, ":\n")) == NULL)
 ! 			break;
   #endif
   		if (!(cp = strsep(&bp, ":\n")))
   #ifdef YP
 --- 282,293 ----
   			if (_ypfound)
   				return(1);
   			else
 ! 				continue;
   		if (strlen(cp) || !_ypfound)
   			_gr_group.gr_passwd = cp;
   #else
   		if ((_gr_group.gr_passwd = strsep(&bp, ":\n")) == NULL)
 ! 			continue;
   #endif
   		if (!(cp = strsep(&bp, ":\n")))
   #ifdef YP
 ***************
 *** 308,314 ****
   			continue;
   		cp = NULL;
   		if (bp == NULL) /* !!! Must check for this! */
 ! 			break;
   #ifdef YP
   		if ((cp = strsep(&bp, ":\n")) == NULL)
   			break;
 --- 308,314 ----
   			continue;
   		cp = NULL;
   		if (bp == NULL) /* !!! Must check for this! */
 ! 			continue;
   #ifdef YP
   		if ((cp = strsep(&bp, ":\n")) == NULL)
   			break;
 
 --------------1CFBAE3959E2B60015FB7483--
 
 
