From nobody@FreeBSD.ORG Wed Nov 10 04:23:37 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id E2DEF14E1F; Wed, 10 Nov 1999 04:23:37 -0800 (PST)
Message-Id: <19991110122337.E2DEF14E1F@hub.freebsd.org>
Date: Wed, 10 Nov 1999 04:23:37 -0800 (PST)
From: kokg@geo.vu.nl
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: getpwent is not enumerating all entries in the passwd file when `+' appears after `+@' (using NIS)
X-Send-Pr-Version: www-1.0

>Number:         14811
>Category:       misc
>Synopsis:       getpwent is not enumerating all entries in the passwd file when `+' appears after `+@' (using NIS)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 10 04:30:01 PST 1999
>Closed-Date:    Sat Dec 30 07:26:29 PST 2000
>Last-Modified:  Sat Dec 30 07:26:41 PST 2000
>Originator:     Gerard Kok
>Release:        3.3-RELEASE
>Organization:
Vrije Universiteit Amsterdam, Faculty of Earth Sciences
>Environment:
FreeBSD pompeii.geo.vu.nl 3.3-RELEASE FreeBSD 3.3-RELEASE #0: Thu Sep 16 23:40:35 GMT 1999     jkh@highwing.cdrom.com:/usr/src/sys/compile/GENERIC  i386
>Description:
If you're using NIS, and there is a `+'-line in /etc/passwd after a
`+@'-line, getpwent doesn't enumerate all entries, i.e. it stops after
processing the `+@'-line. This is a problem with samba-2.1.0-prealpha
that tries to build a hash-table of all users using getpwent.
>How-To-Repeat:
Add a `+@<netgroup>' and a `+' line to the /etc/passwd file. You can then
use a simple program, for example:

#include <sys/types.h>
#include <pwd.h>

struct passwd *p;

int main() {
    setpwent();

    while (p = getpwent()) {
        printf("name: %s\n", p->pw_name);
    };
}

(Another weird thing: some entries are listed twice when I try this on
my machine).
>Fix:
Except for creating a huge netgroup with all users, no solution known.

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: dirk 
State-Changed-When: Thu Nov 9 04:13:03 PST 2000 
State-Changed-Why:  
Please check if this problem still exists. 

I'm using netgroups a lot and haven't encountered any problems 
recently (on 4.1-RELEASE). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=14811 
State-Changed-From-To: feedback->closed 
State-Changed-By: dirk 
State-Changed-When: Sat Dec 30 07:26:29 PST 2000 
State-Changed-Why:  
Feedback timeout. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=14811 
>Unformatted:
