| Summary: | getpwent is not enumerating all entries in the passwd file when `+' appears after `+@' (using NIS) | ||
|---|---|---|---|
| Product: | Base System | Reporter: | kokg <kokg> |
| Component: | misc | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 3.3-RELEASE | ||
| Hardware: | Any | ||
| OS: | Any | ||
State Changed From-To: open->feedback Please check if this problem still exists. I'm using netgroups a lot and haven't encountered any problems recently (on 4.1-RELEASE). State Changed From-To: feedback->closed Feedback timeout. |
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. Fix: Except for creating a huge netgroup with all users, no solution known. 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).