From nobody@FreeBSD.ORG Fri Aug  6 05:03:12 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 16B1B14D24; Fri,  6 Aug 1999 05:03:11 -0700 (PDT)
Message-Id: <19990806120311.16B1B14D24@hub.freebsd.org>
Date: Fri,  6 Aug 1999 05:03:11 -0700 (PDT)
From: david@inty.net
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: bug in getpwent when using NIS
X-Send-Pr-Version: www-1.0

>Number:         12997
>Category:       misc
>Synopsis:       bug in getpwent when using NIS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    des
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug  6 05:10:01 PDT 1999
>Closed-Date:    Mon Sep 6 01:10:05 PDT 1999
>Last-Modified:  Mon Sep  6 01:10:32 PDT 1999
>Originator:     David Hedley
>Release:        3.2-RELEASE
>Organization:
INTY
>Environment:
FreeBSD server.inty.net 3.2-RELEASE FreeBSD 3.2-RELEASE #1: Thu Jul 22 15:18:40 BST 1999     david@server.inty.net:/usr/src/sys/compile/GENERIC+MODS  i386
>Description:
If you have a line of the form '+@netgroup:::::::::' in master.passwd
before a wildcard '+:::::::::' entry, the wildcard entry is not
processed by 'getpwent' when sequentially scanning the password entries.

The problem appears to be that _pw_stepping_yp is not reset to 0 after
scanning through a netgroup (see gen/getpwent.c:unwind) and before 
scanning through the '+' wildcard entry.
>How-To-Repeat:

>Fix:
The following patch fixes the problem:

*** getpwent.c.orig     Fri Aug  6 12:37:41 1999
--- getpwent.c  Fri Aug  6 12:45:43 1999
***************
*** 425,430 ****
--- 425,431 ----
                                } else {
                                        endgrent();
                                        latch = 0;
+                                       _pw_stepping_yp = 0;
                                        gr = NULL;
                                        return(0);
                                }


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->des 
Responsible-Changed-By: des 
Responsible-Changed-When: Wed Aug 11 01:22:46 PDT 1999 
Responsible-Changed-Why:  
I'll handle it. 
State-Changed-From-To: open->closed 
State-Changed-By: des 
State-Changed-When: Mon Sep 6 01:10:05 PDT 1999 
State-Changed-Why:  
Patch applied to -CURRENT and -STABLE, thanks! 
>Unformatted:
