Date: Wed, 10 Nov 1999 04:23:37 -0800 (PST) From: kokg@geo.vu.nl To: freebsd-gnats-submit@freebsd.org Subject: misc/14811: getpwent is not enumerating all entries in the passwd file when `+' appears after `+@' (using NIS) Message-ID: <19991110122337.E2DEF14E1F@hub.freebsd.org>
index | next in thread | raw e-mail
>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: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Nov 10 04:30:01 PST 1999
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991110122337.E2DEF14E1F>
