getpwent() seems to be broken in RedHat 5.2 /sparc, it will correctly return passwd-entries from both the /etc/passwd file and the yp database, but it will return an extra line containing the "+" line from /etc/passwd, and this crashes finger (and possibly other programs as well). The bug is demonstrated by the following program on my system (SS/2 running 5.2 using yp), look for a line with "+::0:0:::" in the output. #include <pwd.h> #include <sys/types.h> #include <stdio.h> int main(int argc, char *argv[]) { struct passwd * pwd; pwd = getpwent(); while(pwd != NULL) { pwd = getpwent(); putpwent(pwd,stdout); } endpwent(); }
This problem does not occur in Red Hat 6.0.